Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Im looking for an action hook to link my function to when a completely new post is created with a status of pending?

I'm aware of 'save_post' and others but want to target specifically when a post is new.

Found this on a previous question:

add_action('new_to_publish', 'your_function');
add_action('draft_to_publish', 'your_function');
add_action('pending_to_publish', 'your_function');

but could do with something like new_to_pending or similar?

any help would be great!

Thanks

share|improve this question
add comment

1 Answer 1

There's the following (/wp-includes/post.php - line 2985):

do_action( 'transition_post_status', $new_status, $old_status, $post )

share|improve this answer
    
hmm interesting! I'l look into this, thanks –  daveaspinall Jul 6 '11 at 14:00
add comment

Your Answer

 
discard

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.