WordPress.org

Ready to get started?Download WordPress

Forums

Missing argument/parameter in hook (1 post)

  1. Hpatoio
    Member
    Posted 5 years ago #

    Hello

    I'm developing an easy plugin and I need to run my task when a comment is approved.

    I've added my action to the hook wp_set_comment_status like this :

    add_action('wp_set_comment_status', 'myfoo' );

    My function looks like :

    function myfoo($comment_id, $comment_action)

    the point is that I always get this message

    Warning: Missing argument 2 for myfoo

    when the action is called.

    How is it ? Shouldn't wp_set_comment_status be called with 2 params ?

    Let me know.

    --
    Simone

Topic Closed

This topic has been closed to new replies.

About this Topic