I have successfully setup an action that executes when a custom post type is moved from "pending" to "publish" status. Everything works as expected when you change the post status individually (press the "Publish" button on the individual post edit page).

However, when using the Bulk Actions on the overview page for the custom post type, the items successfully move from pending to published, but the code below does not get executed.

How can a make sure this code is executed, even if the status is changed via a Bulk Update?

function bang30_publish_pending_response( $new_status, $old_status, $post )
  // Check if we are transitioning from pending to publish
  if ( $old_status == 'pending'  &&  $new_status == 'publish' ) {

    // thank you email to the user.
    $email = '[email protected]';
    $first_name = 'John';
    $last_name = 'Doe';
    $to = $first_name . ' ' . $last_name . '<' . $email . '>';
    $subject = 'Thanks for your submission to CanLand!';
    $message = 'Your submission to canland.org has been published.
    You can now view it online and share what you created with your friends:
    ' . get_permalink($post);


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


nevermind - my issued turned out to be with how to use the $post object correctly.

Both transition_post_status and pending_to_publish are working for this curcumstance.

1 Answer 1


Change your action to pending_to_publish.

add_action(  'pending_to_publish', 'bang30_publish_pending_response', 10, 3 );
  • I tried that too - same result. Commented Jul 27, 2017 at 23:12

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.