Post status transitions
-
I’m trying to perform an action on future_to_publish. The code works fine on publish_post action. I’m using a class and the add_action is in the constructor.
add_action( 'future_to_publish', array( $this, 'doit' ) ); function doit( $post ) { // $post_id = $post->ID; // do stuff here }
do the post status transitions pass a post object or a post id? is $post above the object or is it the post id? I’ve scheduled a post that I had previously published for a future date, say 5 minutes ahead. When it publishes, it doesn’t seem as if the doit() method is triggered.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Post status transitions’ is closed to new replies.