add_action problem
-
Hi there!
I’m writting a plugin, but I have now some problems with the add_action. What I’m trying to do is, when a post is saved / edited or published a function should be called. It sounds easy, but I’m strugling with this since three days.
Here is some code:
function my_function($post_ID) {
echo “hello”;
return $post_ID;
}add_action(‘save_post’, ‘my_function’);
add_action(‘publish_post’, ‘my_function’);
add_action(‘edit_post’, ‘my_function’);Now, when I edit / update post the function will not be called, so the echo is not visible. The echo should be printed out or not? Any hints why the function is not called?
Thanks in advance.
marco_b
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘add_action problem’ is closed to new replies.