save_post
is fired at the end of wp_insert_post()
which is the core function that’s run whenever a post is inserted or updated (wp_update_post()
calls it internally). This includes when the post is updated via the classic editor and the block editor (Gutenberg), as well whenever it’s updated via the REST API. The only reason it wouldn’t fire is if the post was being updated via SQL directly (via a plugin or otherwise), or when only post meta is updated via a function.
So no, this is not the expected behaviour. If your function isn’t firing then it could be interference from another theme or plugin, or it could be an issue with the function itself, but there’s not enough information in the question to say either way.
Related Posts:
- Difference Between Filter and Action Hooks?
- Which hook should be used to add an action containing a redirect?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How Do I Load My Action Earlier Enough?
- Does WP fire delete_post when trashed posts are automatically deleted?
- What’s the earliest point I can get the queried object ID?
- How do I Make a Theme “plugin-ready”?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Is it possible to create an action hook using do_action() within add_action()?
- How can I hook into existing WordPress Bulk actions?
- Define a function outside a class and call the function using action or filter hook
- Create a plugin to change the action to which a function is hooked
- Modifying values with add_action to be sent to db
- Woocommerce – Hide a Column in Cart Table
- Hook to get image filename when it is uploaded
- Which are the hooks run before/after when a category’s deletion?
- Should action callbacks start with a verb?
- Execute Hook on the footer or header after activating a plugin
- Namespaced action and filter tags
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- I have 2 plugins using the same wp_login action hook and one is not working
- How dynamic action login_form_{action} is working
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- How to get all queries’s results after they have executed?
- Bug: Post needs to be updated twice when adding action for save_post hook
- Hook add_attachment error
- Call to undefined function is_home() or any conditional tags
- How to find list of all functions bind to a particular hook from my plugin?
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Action / Hook when a new plugin is added
- apply_filters() and call_user_func() to define and call a function outside a class
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- remove different admin menu for specific users
- add_option_{$option} action hook not being called
- Does WordPress have something like timer hook?
- How can I set a dynamic value for post_updated_messages based on return value of post_updated?
- Insert plugin html content to a specific spot in the frontpage
- Apply function on all action hooks?
- Ninja Forms: Front-End Forms, Post ID?
- How many times will this code run? (or, how rich is grandma?)
- How to create an API for my plugin?
- How to override existing plugin action with new action
- add_action hook for completely new post?
- WordPress Update Plugin Hook/Action? Since 3.9
- Add a new tab to WordPress Plugin install Listing
- Changing Plugin Load Order
- Admin settings update updating every time home page is hit?
- WordPress Hook for user register
- Which action for triggering cron “wp”or “init”?
- Global Objects and Public Methods
- Using filters and actions for plugin API?
- How should you hook a session_start() when authoring a plugin?
- When can you get current page ID and initialize hooks right after?
- add_action with a class method is causing fatal errors
- Init action hook running late after PayPal’s return url?
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- add_filter OO with parameters
- How do I print a notice only on certain admin pages?
- Do I need to call do_action in my plugin?
- Which to use to execute code during the saving of a plugin settings page?
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- WordPress scheduled task is called but not executed
- Using the ‘draft_to_publish’ hook (post status transition)
- A Post is saved twice or more during add_action(save_post)
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- How to add a link to WordPress Plugin install Listing
- How to modify post content before writing to database?
- Actions or filters fired when data is saved in a custom table
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- In a plugin, why is add_action(‘init’) not executed before the plugin is activated?
- Call activation hook multiple times
- How do I handle multiple Submit buttons in plugin’s option page?
- Two-step login process – Is it possible?
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- How to check if certain plugin exists and in expected version
- What action is called when drafts are saved?
- Plugin development, hooks, generate content
- Hook for post permalink update
- When is it too late to call the action wp_enqueue_scripts?
- Dynamically Override Fancy Title
- Get returned variable from a function to add_shortcode function
- Odd behaviour with submenu link creation
- Hook event for upload image in the menu
- Help with callback using do_action_ref_array
- What is the Difference between directly call a function and call a function using add_action?
- How to add custom content under plugin row in WordPress admin plugin list?
- Earliest WP Hook to Safely and Reliably Redirect
- How to register custom post types in a plugin?
- Is it possible to add an action to the currently running action?
- Is it possible to modify the media library admin screen?
- What function to hook for changes made in status and visibility of a post
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- Synchronize Custom post type tags to WordPress default posts tags
- Adding Automatically To In WordPress Using Filter Referencing?
- Order of Operation for these three hooks
- comment_email hook doesn’t seem to work for comment editor field
- Best Practices for Creating and Handling Forms with Plugins?