The documentation for the save_post
action says:
save_post
is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email.
So, you should only need the save_post
action to run the desired code when the post is changed.
Related Posts:
- How to change post status from publish to draft using hook in wordpress?
- Action hook for new pending posts?
- Adding bootstrap classes to video shortcodes
- save_post not working
- How to detect single.php (but not single-portfolio.php)?
- Get old values for post before saving new ones
- Execute function when post is published
- disable WP automatically inserted line breaks after an image
- delete post also attachments
- Action hook ‘wp’ firing twice… why?
- Restrict users from editing post based on the age of the post
- In what sequence are the hooks fired when a post is “published”?
- Code to auto expire posts after 30 days
- List only child categories a post is in, of a specific parent category
- Filter post before *editing*
- Custom colors for post rows based on post meta value
- WordPress Delete hook with wp_delete_post function?
- Custom wp_trim_words() function not trimming right
- How to display post tags
- Custom function for “Submit for Review” hook
- Allow role to delete posts but block him the wp-admin
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- WP_Query in functions.php overrides global $post object, even with wp_reset_query()
- Delete Post From Front-End and attachment permanently
- Limit function to specific post category
- How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?
- Function to show random posts from a category
- Does an action fire when adding a tag via the “Tags” meta box?
- How can I list random authors from current post category?
- Disable single post page
- Enabling post thumbnails for custom post type
- Are posts updated or built from revisions + autosaves?
- Uppercase first sentence in every post
- Ajax posts filter by date, comments, top views, top likes
- Prepend or add an Image to the content of a Post
- Why content_arr[‘extended’] removes paragraph tags?
- Which WordPress hook fires after post content loaded?
- How to display the link (title) and thumbnail post?
- Force the “Choose from the most used tags” meta box section to always be expanded
- How to access $post from a callback function
- How to do set post permalinks using 6 digit random unique function?
- Display post x of y within category
- WordPress Automatic Filename Changer
- Call Web Services on post first publish
- disable Tab post on nav-menus page (Admin)
- What does WordPress do if I save a post without content/title? [duplicate]
- Every second post different class in blog view
- preg_replace not removed “class”
- Get post meta retrieving wrong value
- The_excerpt() doesn’t parse – how to change that?
- Divs appearing everywhere in post content
- Add custom text automatically on each post
- Is it possible to add a shortcode below post title?
- Defined function isn’t showed on page
- WordPress 302 Redirect to Random Product/Post/Page
- Automatically set post_parent value
- Getting Whitescreen when publishing a post [closed]
- Add code to a specific post’s content
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- Is it advisable to use $post->comment_count instead of get_comments_number( $post_id )
- Related Posts: Changing Function For Posts Per Page
- Optimize CPT-function with a loop
- Same post appears in related Posts?
- Making a wordpress page print friendly
- Help on conditional statement to accompany wp_insert_post function please?
- Set Default Post as Parent Child (Nested) Relation
- I need to create “View Profile” and “Edit Profile” links by incorporating the Post Title/ID, but can’t seem to manage it
- how to show comments only author which send own posts in wordpress
- get category in list of posts // shortcode for custom related posts
- Posting to WP via URL
- Is there a way to know when a page has been updated and do some action only once?
- Alt text attributes not showing over portfolio images
- Hook when post is set from published to draft?
- Get Category in save_post Hook
- Set a post expiration and delete a post when expirate
- Count singular post views automatically
- I want to change the WordPress comments file
- Replace Tag Keyword With Link Within Post Content
- Excluding tag Link from html tags in Post content
- Changing a users posts to drafts upon role change
- Get post id outside loop : Notice: Trying to get property of non-object
- Trim excerpt to first paragraph
- im trying make a function to auto correct posts when i open the posts in the backoffice
- wp query custom orderby not custom field
- How to change number of posts shown on homepage vs other pages?
- Show only top 3 posts from 3 categories in order on home page
- How to get posts from network blog
- How to limit the number of results for all query_posts on mysite
- User driven content problems
- Which hooks are essential for post templates?
- How *not* to show the last post on the latest posts list
- Notify Author of the post if admin deletes his post and perform some function
- How do we display a certain category type on a page while hiding all others?
- Insert Shortcode exactly at the end of the content
- display last post modified date in genesis child themes
- What function does the loop of displaying posts?
- transition_post_status hook, works – but not if the post is new
- Admin notice on wp_insert_post
- How to use shortcode to get the second to newest post?
- How to sort posts alphabetically based on a specific parent category