You need Post Status Transitions actions
function notify_me_for_pending( $post ) {
$user_info = get_userdata ($post->post_author);
$strTo = array ('[email protected]');
$strSubject="Fstoppers: " . $user_info->user_nicename . ' submitted a post';
$strMessage=""" . $post->post_title . '" by ' . $user_info->user_nicename . ' was submitted a post for review at ' . wp_get_shortlink ($post->ID) . '&preview=true. Please proof.';
wp_mail( $strTo, $strSubject, $strMessage );
}
add_action( 'draft_to_pending', 'notify_me_for_pending' );
add_action( 'auto-draft_to_pending', 'notify_me_for_pending' );
Related Posts:
- how to limit edit_form_after_title hook to page and post edit only?
- Action hook ‘wp’ firing twice… why?
- Count singular post views automatically
- How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?
- How can i do something after head like adding a hook for after head but before post
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Adding buttons to Add New Post and Add New Page
- How to access $post from a callback function
- Copy post to separate database with “add_action(….)”
- Call Web Services on post first publish
- What does WordPress do if I save a post without content/title? [duplicate]
- Divs appearing everywhere in post content
- Automatically set post_parent value
- Is there a way to know when a page has been updated and do some action only once?
- Is update_post_meta used when save_post action hook is invoked?
- Count singular post views automatically
- Grab meta data before post is saved
- Modify upload directory to use post category slug in file path on multisite installation
- Stop WordPress Wrapping Images In A “P” Tag
- Is there a action hook for the “Empty Trash” button?
- Keyboard shortcut for updating a page or post?
- Function to execute when a post is moved to trash .
- add action only on post publish – not update
- Customizing HTML Editor Quicktags button to open a dialog for choosing insert options
- Hook that get’s triggered when the author of a post is changed
- Allow user to “edit_others_posts” to save only, not publish
- How to validate XML-RPC post creation and cancel when needed?
- The hook for the AJAX Add to Cart button?
- Get old values for post before saving new ones
- Let private posts stay in status “private” after edit through “editors”
- Execute function when post is published
- Create posts on user registration
- Sends out email to admin
- Listen to Post action
- How to create WP Editor using javascript
- How to publish a post with empty title and empty content?
- How to add editor’s name to entry meta byline?
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- How to add a “publish” link to the quick actions
- When a user creates a post (pending), send a confirmation link that allows them to publish
- In what sequence are the hooks fired when a post is “published”?
- Restrict access to post if it is currently being edited
- Change padding to text indent in “Increase indent” TinyMCE
- How can I allow editors to leave comments on posts that have not yet been published?
- Automatically added brs and paragraphs?
- Better post meta efficiency?
- One comment per user email per post
- How can I pass $post object to ‘save_post’ add_action?
- How to change post status from publish to draft using hook in wordpress?
- Filter post before *editing*
- WordPress Delete hook with wp_delete_post function?
- Get the post_id of a new post
- First hook to use current page post id
- add image map script to post
- Content editor creating blank paragraphs in spaces and creating   in the_excerpt
- How to filter content post only on save
- Send email to user that his post has been rejected
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- Posting via email, where do I start troubleshooting?
- How to place HTML below the title of the (custom) post overview
- How do I allow users to follow a post and then allow admins to email all users who have followed that post?
- 2nd button row from WP Super Edit or TinyMCE Advanced doesn’t show to 2nd admin
- Does an action fire when adding a tag via the “Tags” meta box?
- Strange problems when I try to insert HTML\XML code snippet in my posts
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- add_action not using ‘delete_post’ action with wp_delete_post
- the_posts filter been called multiple time
- Get post id in wordpress action?
- Are posts updated or built from revisions + autosaves?
- How to run a function when post is edited or updated using publish post action?
- Create cron job without a plugin?
- Visual / HTML tabs vanished on editor
- Getting a 404 error when clicking edit page
- How to generate numbers indistinguishable for the IDs of the posts
- WordPress version 3.8 – Preview button not working for editor
- Action hook for new pending posts?
- Register post status, exclude from searches
- Receive each week the number of posts published
- Make Post Editor Select Number of Columns To 1 By Default
- How to modify post content?
- Email entire post contents
- Which WordPress hook fires after post content loaded?
- What is the filter or hook to add admin controls to posts on the front end?
- Adding custom fields to bbpress reply form
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- Hide a specific category in admin All Posts page (WordPress)
- Updating post data on save (save_post vs wp_insert_post_data)
- Lost draft under all posts and drafts
- Set static page/post from another blog on same network
- Hooking into the post editing screen for an existing page only
- Trying to alter the post_content through the_post
- How to check if single.php has already called the_post_thumbnail function
- How to dynamically parse and transform post/page content before displaying it?
- Send a review notification email to admin when a post is 12 months old
- Adding bootstrap classes to video shortcodes
- New Gmail email to a WordPress new post? [closed]
- preg_replace not removed “class”
- why the same code got different results when using query_posts in functions.php and index.php
- WP text styles not coming through to actual post
- Modify posts listing at back end