WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Posts may be published either immediately or in the future.

Suppose a plug-in wants to do something at the moment when the post becomes published and visible on the blog (I don't mean when the post is saved as published in the admin panel with whatever date). Is there a hook like "post_visible" or something similar.

share|improve this question
up vote 1 down vote accepted

Every time a post changes status, wp_transition_post_status function will be called. This triggers the actions ${old_status}_to_${new_status} and ${new_status}_${post->post_type}, so for example publish_post will be triggered here. A post with a date in the future will have the status future until it is actually published, so this should work for you.

share|improve this answer
Could you please give an example of the action names . Will the actions triggered be "future_to_published" and "publish_post"? – rsman Sep 8 '10 at 16:03
Indeed, publish_post will certainly be triggered, and future_to_publish if the previous status was future (I don't know the initial status if you publish immediately). Mike also gave some interesting hooks in an answer to a related question. – Jan Fabry Sep 8 '10 at 19:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.