The action save_post is also called during AJAX auto-save requests. But your value is not sent then, so you save an empty value for something that isn’t set.
Start your save function with:
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
Related Posts:
- How to only hook on Single.php after content?
- How can I log a user out of WordPress before the page loads?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- Autogenerate wordpress shortcodes using array?
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Is there a global action for when a plugin is uninstalled?
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- How to remove action from plugin?
- Very stubborn wp_register_script / add_action vs remove
- do_action and hook methods
- Is it possible to add an action to the currently running action?
- Is there an action that is called when a post is restored from the trash?
- Action on post publish
- How to add inline css/js inside a shortcode
- How to prevent action in ajax request, when in admin side?
- Placement of Code in Plugin for hooking `save_post`
- Can I use a method from an existing plugin as an action hook?
- What are the benefit in adding hook in the init() hook?
- Detect when any plugin is activated or deactivated
- Where to hook my plugin’s action
- Overwrite or Replace code in WP_Footer
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Any hook for pre-plugin-update -either bulk or single plugin update
- wordpress plugin is not activating from widget
- When to load auto-login code?
- How to get all of the activate_plugin action parameters?
- Keep a post copy when this one is updated – issue
- Get Time Taken By Each Action Hook in WordPress
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Removing an action from wp_footer called in a class that’s inside a bigger class
- WordPress user account activation
- External Script Using WP – Hooks / Actions Not Working?
- add_action in a custom plugin
- What is @Action in WordPress?
- Problem with removing plugin action
- edit_user_profile and show_user_profile are not firing inside a class
- Add action to fire when a published post is updated
- Save values from a pre_post_update
- get gravity form ID from backend/wordpress admin
- How to pass variables to a function argument using add_action [duplicate]
- _prime_post_caches in wordpress
- Run a plugin just ‘once’ per page reload
- Using add_action before add_filter on a plugin?
- Submit Form data to another page via Ajax (WordPress Way)
- Why do plugins often ask to add in to templates?
- Create a post builder skin in a plugin
- remove_action not removing add_action from constructor
- How to get menu location in wp_update_nav_menu hook
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Hook for page Request?
- How to remove a class function from a plugin by using remove_action()?
- Advanced WordPress plugin activation detection
- Trying to add_action in a loop
- how to execute some code after a post is published in WordPress [duplicate]
- How to remove products-links after the product title using remove_action
- Action on WordPress Install
- wp_ajax action responds with 0
- Custom CSS not being added by plugin
- Retrieve options set through a plugin
- How to use add_action for multiple instances of the same class
- What hook can I use to modify custom post data before it is displayed on the page?
- How to hook into action/filter call
- Running a function with args in add_action()
- I cannot include a file in my plugin settings page
- help intercepting save_post through plugin
- Edit post image attributes on fly?
- Displaying page content from plugin, inside exising empty WP page
- Callback hooked to post_updated firing on new posts as well
- Why do actions with class and public method don’t fire __construct()
- Sharing varible between two add_actions
- Discern a specific plugin’s action hooks
- add_action(‘the_content’, ‘my_plugin_content’) is null
- How to remove default action from a plugin?
- Removing Plugin Action via Theme for Non-admins
- Get post content inside plugin class method
- Ajax call to php function doesn’t work PHP code
- On save_post need to wp_insert_post and save partent post id to child post and child post id to parent post
- Frontend AJAX Request causes Error: ‘Call to undefined function add_action’
- Creating Admin Submenu Page via Class Method
- Help needed with woocommerce (wc stripe) filter
- What action or filter can I use to change all the html returned from server for a page?
- Why doesn’t a form need an ‘action’ with a plugin that uses the post data?
- how to repeat taxonomy in different places on wordpress
- Am I using an action hook correctly?
- plugins_loaded action is not working properly
- AJAX login without a plugin does not work. when add a action to function.php
- Remove action working on functions.php but not in a plugin. Why?
- add_media_page function not creating submenu
- change output location of plugin function using a custom hook
- Remove action plugin
- Removing this filter added by a plugin
- Filter for modifying image on upload
- Which filters or actions involve with index page for plugin?
- OOP Plugin: Where should I place the action hooks in the class?
- add query string to all pages after user logged in
- How wordpress plugin hooks works? [duplicate]
- Hook automatic_updates_complete to autoupdate plugin
- My wp_update_nav_menu action is firing twice
- add_action() not working for admin
- How to customize WP_Error (REST JWT authentication plugin) [closed]