Retrieve Post ID when using publish_post hook
-
Hi WP experts,
I working on a plugin where I need to retrieve the current post ID when using publish_post hook.add_action( 'publish_post', 'myFunction' ); function myFunction() { //Retreive current post post ID and store in $my_Post_Id // Do something with $my_Post_Id }
Thanks
Jacques from France
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Retrieve Post ID when using publish_post hook’ is closed to new replies.