Support » Plugin: Code Snippets » Cannot redeclare wp_notify_postauthor()

  • I am trying to run

    function wp_notify_postauthor( $comment_id, $deprecated = null ) {
    if ( null !== $deprecated ) {
    _deprecated_argument( __FUNCTION__, ‘3.8.0’ );
    }

    $comment = get_comment( $comment_id );
    if ( empty( $comment ) || empty( $comment->comment_post_ID ) )
    return false;
    .
    .
    .

    add_action( ‘comment_post’, ‘wp_notify_postauthor’, 10, 2 );

    but I get the following error…

    Cannot redeclare wp_notify_postauthor() (previously declared in /srv/users/serverpilot/apps/wordpress/public/wp-includes/pluggable.php:1383)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hey,

    Unfortunately, it’s not possible to redeclare pluggable functions in Code Snippets at this time. pluggable.php is loaded immediately after plugins are loaded, which is before snippets have been executed.

    This might change at some point, but for now you might need to use a workaround for this.

    Received similar error message as mentioned below:

    Fatal error: Cannot redeclare wp_notify_postauthor() (previously declared in /home/vol4_1/epizy.com/epiz_21191708/htdocs/wp-includes/pluggable.php:1383) in /home/vol4_1/epizy.com/epiz_21191708/htdocs/wp-content/plugins/comment-emailer/notify_postauthor.php on line 147

    Above error message was displayed while activating a plugin called “Comment Emailer”

    If there is any workaround, please let me know. Thanks

    Plugin Author Shea Bunge

    (@bungeshea)

    @paulmani: It looks like this is an error with the Comment Emailer plugin you just activated. Perhaps you should ask in the support forum for that plugin instead.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cannot redeclare wp_notify_postauthor()’ is closed to new replies.