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.

I am looking for the right hook to use for sending out an email notice when a post is inserted. However, I am using custom statuses (in this case 'holding') which doesn't seem to get hit with the new_to_holding hook, so was hoping someone knew of an alternative that gets fired when a post is inserted or perhaps a reason why that hook isn't working right.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

new_to_holding doesn't exist as a post status transition - you need to use the generic transition_post_status action. Something like (untested):

add_action('transition_post_status','my_holding_function', 10, 3);

        function my_holding_function( $new_status, $old_status, $post ) {
            if ( 'holding' == $new_status ) {
                // do stuff
            }
        }
share|improve this answer
    
Thanks for the reply, I didn't get a result with the above but I am still playing with _transition_post_status –  Kyle Mar 15 '13 at 14:04
    
Oh this did work, I was doing it wrong :) –  Kyle Mar 15 '13 at 14:27
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.