You’re looking for the save_post
action. This allows you to add a function when a post is saved (updated).
You can hook into it like this:
function your_save_post_function( $post_id ) {
}
add_action( 'save_post', 'your_save_post_function' );
Remember to not change WordPress Core files, as these will be overwritten when WordPress is updated. You can put this code in your functions.php
file, or anywhere else in your theme folder.
Related Posts:
- Action on post publish
- How can I make it so the Add New Post page has Visibility set to Private by default?
- Publish Post After Click On A Link
- Is there an action that is called when a post is restored from the trash?
- How to filter content post only on save
- Function added to hook “new_to_publish” not executing – custom plugin
- trigger email when post is published by someone a user follows
- What hook can I use to modify custom post data before it is displayed on the page?
- How to write a new file when new post has been published in WordPress
- Add new post using a page inside the website
- How can I see all the actions attached to an “add_action” hook?
- Where is the best place to use add_filter
- When can you get current page ID and initialize hooks right after?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Disallow a user to post in certain categories
- Article source link for posts
- Which hook callback has priority if both plugin and theme use the same hook?
- Use external link in the add sub menu
- delay function on publish?
- Custom Post Type causes Page Not Found
- Can a plugin add to header/footer/body content?
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- How to call bind function in wordpress actions or hooks
- Display future posts?
- Output HTML only on individual post view
- add action for displaying posts using a shortcode
- ‘wp_login’ action hook not working with wp-login.php file
- Portfolio + Blog: multisite or plugin?
- How to Use Parameters with a Do_Action Function Within PHP Tags
- WordPress filter that hook after each action/filter hook
- How to enable qTranslate languages tabs in custom plugin page
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- How to hide some section in WordPress under Post
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- posts comments goes to trash
- How to get post ID with hooks publish_post, new_to_publish, etc
- Problem with removing plugin action
- edit_user_profile and show_user_profile are not firing inside a class
- Is it possible to send blog posts via email to subscribers?
- Custom setup of wordpress comments that are displayed
- Is there any plugin which can paste a common content to my every post?
- Import Instagram post to WordPress blog post
- the_post hook is not firing for me
- do_action Nested List
- How to get all posts belongs to a user between a certain date
- Plugin Development – Functions or Hooks?
- How to create Admin Notice from Plugin with argument? [duplicate]
- Making my plugin create a page?
- Editing wp-config.php
- How can I automatically download all images from all imported posts, place them on my new host, and replace all the links
- How to remove a class function from a plugin by using remove_action()?
- check uncategorized category by default
- Post deleted in trash [closed]
- Action on WordPress Install
- How to relate 3 wordpress components with each other (Create database relationships)
- Retrieve options set through a plugin
- get current page number with wp_link_pages()
- problem with register_activation_hook in plugin
- Delete data from custom table when deleting a post
- Plugin is creating posts twice
- Running a function with args in add_action()
- How to Get Recent 5 post in My Title bar?
- Plugin for visitors to edit content without logging in? [closed]
- WP Insert Post If user refreshes override new post
- Summary and Comments on Main landing Page
- Method/Plugin/Hack to Start a Post with an Writing Outline?
- Displaying page content from plugin, inside exising empty WP page
- Oops! That page can’t be found
- page duplication on wordpress that wont stop
- WordPress is redirecting me to homepage
- Adding custom post category to categories widget
- Callback hooked to post_updated firing on new posts as well
- Discern a specific plugin’s action hooks
- Allow members to create groups on my site
- Get post content inside plugin class method
- How to wrap image tag into div for post only?
- What action or filter can I use to change all the html returned from server for a page?
- My own metabox checkbox plugin only saves the last value I’ve checked
- How to prevent authors from editing their post count?
- how to repeat taxonomy in different places on wordpress
- Remove action working on functions.php but not in a plugin. Why?
- How to use shortcode of any plugin to show it visually where i want?
- WordPress not updating post or disable plugin instead a white page appear
- Removing this filter added by a plugin
- Ger posts from similar tags and categories
- Which filters or actions involve with index page for plugin?
- single.php fires more than once after clicking on any post to view with different post id each time
- Twitter List Tweets and Delicious Links as Posts
- How to make only selected posts appear on a selected wordpress page
- How to block external download link access if visitor not referred from WP?
- WooCommerce Order Status Displays Twice on Order Page
- Action while post is being published
- Notifications Bar on home page only
- Distribute post content through several divs [closed]
- Does anyone have the Custom Post Permalinks plugin from John P. Bloch? [closed]
- How to get an error message if a form is empty (plugin: Post for site) [closed]
- Is there a plugin or another way that can help me find out the underlying files of a page/post? [closed]
- How to update a lot of posts on my WP site with additional content?