0

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.

1 Answer 1

2

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
            }
        }
2
  • 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, 2013 at 14:04
  • Oh this did work, I was doing it wrong :)
    – Kyle
    Mar 15, 2013 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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