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?)
- add_action hook for completely new post?
- WordPress Hook for user register
- Which action for triggering cron “wp”or “init”?
- Using filters and actions for plugin API?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- Actions or filters fired when data is saved in a custom table
- In a plugin, why is add_action(‘init’) not executed before the plugin is activated?
- Call activation hook multiple times
- How to check if certain plugin exists and in expected version
- Is it possible to modify the media library admin screen?
- What function to hook for changes made in status and visibility of a post
- Order of Operation for these three hooks
- save_post hook not triggered in WP v3.6.1
- How to redirect to action on custom page within admin section
- What are the benefit in adding hook in the init() hook?
- How to display a message about updates in the plugin list
- How to run an add_action hook for specific page
- Which action is triggered when a theme was modified?
- wp_transition_post_status does not change the status of the post
- How to delete an user including data from custom database tables
- action hook wp_head higher priority as all other plugins/hooks
- What filter should I use to insert a button inside on Media>Add New
- Issue plugin commands in admin settings page
- My plugin class doesn’t work! [closed]
- add_action not calling back to function
- How to use a hook to override an update_post_meta call in a plugin?
- External Authentication, session_tokens not destroyed on logout
- correct way to call javascript into hook function
- How to get all of the activate_plugin action parameters?
- Send push when new post is published in a certain category
- Force HTTPS 301 redirect with hook
- use of do_action() without any functions attached
- Plugin uninstall function is not working
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- How can I create a custom plugin that allows anonymous users to signup without registering?
- Bind a function with its own argument to show something dynamically after every content
- A question about add_action()
- What’s the hook for filtering every texts of site?
- Associate multiple email addresses with the same user account, so they can log in with either
- Update variable value via add_filter
- Custom filter not working
- hook update_option/updated_option empty $old_value and $value
- Configure WordPress to Generate Scheme-less Relative URLs
- How to do admin ajax request in a plugin for rest api
- ajax-action.php can’t find added action
- Problem in plugin debuging in wordpress
- OOP development and hooks
- Add_action not calling callback function
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- Function not working on any file other than the main plugin file
- Multi hook deploiement
- Can I use a hook other than ‘init’ to handle form submissions?
- action callback, for action dispatched as reported by hook sniffer, not called
- woocommerce single product page hook not working
- Plugin Hook: Get posts
- What is the use of wp_schedule_event hook?
- Sending Parameter Failed
- get_term_by() returning null on plugin