publish_post not working
-
Please help! I can not for the life of me get this to work, it never fires. I am trying to create a function to do something when a post is first published.
This code never seems to get called:function on_post_publish( $ID, $post ) { // A function to perform actions when a post is published. echo '$ID: '; var_dump($ID); echo '$post: '; var_dump($post); echo '<script type="text/javascript">alert("Made it to the function!");</script>'; } add_action( 'publish_post', 'on_post_publish', 10, 2 );
- The topic ‘publish_post not working’ is closed to new replies.