Notify user for post status change
<?php function notify_post_status( $post_id = NULL, $user = ” ) { if ( ! isset($_POST[“post_id”]) ) { $post_id = $_POST[“post_id”]; } else { return $post_id; } $post = get_post($post_id); $status = $post->post_status; $type = $post->post_type; $author_id = intval($post->post_author); $user = get_userdata( $author_id ); //ignore admin if( $author_id == 1 ) return; // Which statuses should…