You can use a hook developed for such kind of purposes: post_updated
Use this hook whenever you need to compare values before and after the
post update.
Lets get some codding:
function mail_on_update($post_ID, $post_after, $post_before){
if($post_after->post_content != $post_before->post_content){
// wp_mail() , mail() here
}
}
add_action( 'post_updated', 'mail_on_update', 10, 3 ); // 10 - priority, 3 - qty of parameters passed to action callback.
Put this code in your theme functions.php
and modify with conditional logic for mailing.
Related Posts:
- How to remove fresh posts (latest news) on the main page? [closed]
- How to use “Add link” pop up for a WordPress widget
- How to get all posts related to particular category name?
- Add tag to post api wordpress
- Add a new post status in the post progression
- How to add a quicklink to the Posts Admin Published|Scheduled|Trash menu
- How to show list of posts by author and category?
- Getting the Next and Previous Posts Titles in the Sidebar?
- Email admin when post pending?
- How to control which category will be picked for the slug of a post?
- How to hide the Text Area in the Post Edit screen
- upload image in a meta box
- Search posts by post author name
- Why is our post editor stuck at cols=40?
- Adding a Nav menu to post admin
- how to limit and display tag?
- How to Display Post View Count
- Adding Multiple Values to a Post Meta Key
- Warning: Creating default object from empty value in … /post.php
- get custom image size
- Does an article (post) id ever change?
- Display page content AFTER a loop of posts
- How to get the date of a post in WordPress, so I could use it in a script?
- Check is_single() outside loop
- Only display a certain number of posts, dependent on how many posts there are available in a query
- how to replace embedded “full” sized images within a post with the “large” ones
- Downgrade user from role that allows post creation
- Change default Posts page
- Batch process: remove first image from post content
- Create post for every user?
- Facebook Share Thumbnail
- Yearly archive page for future year
- How blog page in WordPress works : blog page retrieve first post ID
- Delete WordPress posts from URL list sql query
- Posts with multiple authors with different roles
- How to get the user meta data for a post?
- Custom WordPress Theme: Publish Date and Display Date for posts right beside each other
- How to change permalink on post click on post listing page
- Auto insert More tags in all posts
- Blog post per page setting conflicting with custom WP_Query?
- Show certain posts in a LIST format that members have been granted access to
- WordPress Rest API Create Post
- How to get next post ID?
- WordPress custom Query for Posts in Category display posts multiple times
- performance of post_exists
- Add a custom meta box in the post options that loads some html code in the header
- Display an author’s posts on his own author page
- How would one change the default url structure of attachments?
- Use two different post_per_page limits with infinite scroll
- A/B testing of posts with unique URLs for each variant AND editing in custom fields
- How to dynamically parse and transform post/page content before displaying it?
- getting “Object of class WP_Post could not be converted to string” – when it is a string
- How to get posts published on the latest date?
- Using setup_postdata() with multi-dimensional array
- Bolding several words at once
- Post Form Results to Table in Same page
- Post Title to featured Image ALT
- I don’t want the complete article to show on homepage
- wp_query if have posts show date but not in loop
- Get posts from current category?
- Send email to admin with post author
- posts going to 2 pages/categories only show up in 1
- How do I get the image that is submitted with a post, when I’m in the loop?
- How to output all taxonomy links from a custom post type in a menu?
- Cannot create new posts or upload images using media manager
- How can i showcase all my galleries?
- Rewrite image links from attachment id to attachment link
- How do I change the template specifically for single posts?
- wp-insert-post execute from server?
- Change the size of the featured image for post?
- Send email to user when I publish a new post
- Change URL of previous posts and next posts link in WordPress
- I want to show recent post according to category of the post in single.php?
- Limit amount of categories displayed in a post
- Custom Post Types and Broken Permalinks
- I lost the link to my posts in my menu bar
- Allow registering user to select post category when signing up to blog
- how to call recent post content in a loop ( only the content before read more tag)
- How do I use slideToggle inside a wordpress post?
- Display author bio box
- Bulk posts from DRAFT Section
- Get posts by category or author
- How to make post button to a random post
- How can I have the posts from one word press blog show on the presentation page of another word press site
- Where is object, property or label in the database that controls the order of the posts being displayed?
- Is there a way to change the complete URL of the blog post for a redirecting tracking link?
- My posts section for logged in user
- Display the popular tags by default in the backend post edit page (without having to click on the link that displays them) [closed]
- How to get single post by one author?
- Latest posts on all pages
- Getting 404 when using rewrite rule for posts
- Posts and pages not getting published
- How to create a post based on data in a table?
- Display all posts from selected month
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- Permalink remain the same on each page
- Displaying warning if no featured image has been set – Post Editor
- wordpress show category link instead of post link [closed]
- website images getting corrupt automatically
- Posts Page in WordPress loading bare HTML of my homepage