When hooking on to save_post you need to check that it’s not a revision & is not WP autosaving the data..
You’ll need this code before you send the email so it returns if it’s autosaving or is a post revision.
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {
return;
}
if ( wp_is_post_revision( $post_id ) ) {
return;
}
The post revision one is the first example on this page: http://codex.wordpress.org/Plugin_API/Action_Reference/save_post
Related Posts:
- Customize users’ capabilities to change a custom post’s post status
- How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
- wp_publish_post breaks permalinks
- Posts created in a Custom Post Type are lost if published without a title
- Registration and Custom Post Types – How to synchronize information?
- Changing wordpress publication date to ACF date and time picker date not working
- Custom post type suppress transition from future to publish
- “Submit for review” for updates on existing posts
- How can I move (or create another) publish button?
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Get only used meta_values
- detect when a custom post is cretaed for the first time
- Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
- Publish box in CPT remove ‘edit’ link
- Limiting the Number of User Posts to Their Own Posts
- Update main post with same category when creating custom post to update the modified date
- Modify Publish Metabox location on CPT
- ACF saving posts
- Publish post and create additional posts with same content
- Disable Facebook Comments Automatically On CPT
- How can I get taxonomy terms and custom field values of a newly created post
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Updating User Meta from Custom Post Field Upon Publish Not Working
- Emailing Authors only when a CUSTOM POST TYPE post is published- not when edited later [duplicate]
- Storing revisions of metadata for custom post type
- Select All in Parent Category, Group by Child Category?
- Custom post types and child theme
- setup_postdata is not returning any values
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- How to Add Pages Under Custom Post Type URL Structure?
- Remove base slug in CPT & CT, use CT in permalink
- Dynamically create/remove terms in taxonomy when custom post type is published/trashed
- Pagination Custom post type
- custom post type index page
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- Custom posts filters in admin
- Check Title Unique Or Not and If not error message and dont save
- Menu Multiple Taxonomies
- Add Tags to custom post type
- WordPress as Wishlist Application
- Open div inside a custom post-type with Fancybox
- Display all posts in main category and 1 subcategory
- uploading images to specified directories
- Is it possible to have dedicated page for parent/child taxonomy?
- How to import a custom MySQL DB table into a WordPress custom post type
- Custom post type permalink returns 404
- Add custom post type drafts to RSS feed
- cutsom posts 404ing
- Different slug taxonomy for two different CPT
- Getting WordPress Flexslider Item Number
- Why does my taxonomy have a category style div id?
- Sorting posts by custom field value in array
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- How to populate a Gravity Forms Custom Post Field (dropdown type) with custom taxonomy terms? [closed]
- Different column width in 2 rows with bootstrap and custom post types-different classes needed
- Custom Post Type Root Template
- Correct way of adding taxonomy to a custom post type
- custom post template ignored after altering permalinks
- Custom Post Type Implementation
- Why will comments not remain open on custom post types?
- Visualize info in just custom post_type in theme
- Using get_post_type with a custom URL format?
- Using Orderby and meta_value to order natural/alphanumerical
- get comments for custom post type
- Using post title in an array
- Post Editor: display categories from current post type taxonomy only?
- How to customize admin edit page – custom type
- Add Image field to CPT
- Create a list of months based posts
- single-{post-type}.php
- Can a user drop a HTML Shadow DOM into a blog post?
- How to alter query so that image changes in order every time page is refreshed
- How to add custom permalink struct with DYNAMIC author to a Custom Post Type
- WPNavi pagination links not working on custom pages
- Rewrite Rule for custom post type link with or without taxonomy terms
- How to add to taxonomies to a post type
- Custom plugin contact form connecting to mailchimp API
- Posts structure named to blog, how to add month and year
- How to change post cpt with submit button?
- Filtering custom post types using category taxonomy
- Storing every individual update to the posts being updated over time?
- Rewrite nested urls for custom post type
- Custom Post Type featured option
- Change post structure
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?
- Custom post type Premalinks main page and details page
- Two custom post type relations
- Update Custom Field daily within 7days
- set_post_thumbnail or media_sideload_image adds image multiple times in media library
- How to use wp_set_object_terms depending on page ID?
- Change CPT Edit Target Link for Admin List
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?
- custom taxonomy not return in the code
- Rewrite rule taxonomy url with different values in one function
- How to display posts from IMPress for IDX Broker on home page? [closed]
- Permalinks for Custom Post Types and Taxonomies
- Group search results by post type, but having a unique heading for each section?
- selecting custom post types and taxonomies for hub page listing blocks
- Remote database access on another wordpress site’s custom post type
- How do I get parameters from the URL?