Skip to content

Instantly share code, notes, and snippets.

@bainternet
Created January 30, 2012 20:36
Show Gist options
  • Select an option

  • Save bainternet/1706524 to your computer and use it in GitHub Desktop.

Select an option

Save bainternet/1706524 to your computer and use it in GitHub Desktop.
Notify admin on new post pending
<?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