WP Post status action hooks not triggering
-
Hi!
When updating a custom post type (“performance”) using the GF updater plugin, a function I wrote to notify the admin when a published performance is changed does not fire. It does fire when editing the performance directly in the backend.
Here’s the function:
//send admin email when a published performance is changed by user function bits_performance_update_notification( $new_status, $old_status, $post ) { if ( $old_status == 'publish' && $new_status == 'publish' && get_post_type($post) == 'performance' ) { $post_url = get_permalink( $post->ID ); $subject = 'A published performance has been changed'; $message = "The following performance was changed:\n\n"; $message .= $post->post_title; $message .= $post_url; $email = [email protected] ; //sends email wp_mail($email, $subject, $message ); } } add_action( 'transition_post_status', 'bits_performance_update_notification', 10, 3 );Any assistance would be appreciated. Thank you!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘WP Post status action hooks not triggering’ is closed to new replies.