I'm trying to add a custom post status "Needs Review" for posts/pages that have been updated by an editor, so that admins can easily see what has been updated and review the changes.

The planned workflow for status's would be as follows:

Draft > Pending > Published > Needs Review (updated by editor) > Published (after review by admin)

So far I have been able to create the custom post status using the register_post_status action. What I am stuck on is trying to figure out how to transition to the new post status when a user saves a published post.

I thought about hooking into the publish_to_publish action, and changing the post status to "Needs Review" using the wp_update_post() function, but it seems like it would make more sense to use whatever function that tells WordPress what to do when a user saves/updates a post.

Any ideas on what would be the best action to hook into to set a custom post status when a user updates a published post?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.