The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Missing argument/parameter in hook (1 post)

  1. Hpatoio
    Posted 7 years ago #


    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.


Topic Closed

This topic has been closed to new replies.

About this Topic