I am writing a small plugin that needs to execute after someone has posted a comment and I don't think it is triggering properly.
Is there an easy way to test it?
function myfunction($comment_ID) {
update_option('test_respsonse', 'This should be saved');
}
add_action('comment_post', 'myfunction');
Technically shouldn't myfunction() get executed when someone submits a comment?
On the admin page for the plugin I have something to this effect:
echo "Repsonse: ". get_option('test_response');
But it does not show any changes so I am assuming my add_action() hook isn't executing properly.
What am I doing wrong?