Created
January 30, 2012 20:36
-
-
Save bainternet/1706524 to your computer and use it in GitHub Desktop.
Notify admin on new post pending
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action('new_to_pending','notify_admin_on_pending'); | |
| function notify_admin_on_pending($post){ | |
| add_filter('wp_mail_content_type',create_function('', 'return "text/html";')); | |
| $message = ' | |
| <p> | |
| You have a new post pending a review:<br /> | |
| '.$post->post_title.' <br /> | |
| <a href="'.get_edit_post_link( $post->ID).'">Edit the Post</a> | |
| </p> | |
| '; | |
| @wp_mail( get_bloginfo('admin_email'), 'new Post Pending', $message); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment