Adding function to hooks is runtime operation, it is not persistent. Whatever hook operation you run in Ajax actions – they are performed in separate WP instance and expire as soon as Ajax response is returned. They have no influence on currently loaded page.
You probably need to hook your functionality to save_post
as usual (not in Ajax action) and check for your additional metabox to handle it.
Related Posts:
- prevent post submission
- Passing error/warning messages from a meta box to “admin_notices”
- Metabox with checkbox is not updating
- Access the environment of an admin page from another admin page
- Why is `add_meta_box` not working?
- Save checkboxes of a metabox with a foreach loop (invalid argument)
- Metabox of one post influence setting on other
- remove_meta_box for all post types doesn’t seem to work
- Custom Metabox with Ajax in Edit Post – Stuck
- unable to save post meta on single field with multiple selects
- Undefined ‘post_type’ error on Add new page
- Metabox saves on Update or Publish, but not on Saving Draft
- save_post action to include wp_insert_post_data filter, gathering meta field info & prevent infinite loop
- Meta box html is not updating after saving
- Getting gutenberg (WordPress 5) to save TInymce data?
- How to prevent further updates of custom meta when using actions to set one meta based on another
- Stop saving process when metabox is invalid [duplicate]
- Add custom action in post type
- How to position user meta data field
- How to create a button click counter meta box?
- Why does not my metabox save?
- What do the numbers mean at the end of add_action(‘save_post’)…?
- Migrating from metaboxes to wp_editor()
- save_post_{$post->post_type} action firing on second save
- Save meta data with post, Without using any plugin [closed]
- Remove meta box except on category pages
- Editor meta box Showing but not saving
- Custom loop attached to link
- save radio button selection in post-meta on submit
- Post and Pages section inside WordPress admin are completely blank
- Saving multiple fields (dropdown and text) in custom metabox
- Meta Box – Javascript Datatable
- A correct hook for saving meta boxes data
- Reload meta box content with AJAX
- Metaboxes not saving data
- Add a Meta Box for uploading a SECOND Featured Image?
- Remove the Yoast SEO Post Metabox [closed]
- Sample code for validating custom metabox?
- How to add a class to meta box
- Custom post type save_post action not firing
- Add Meta box Befoure Post Title
- Editing Screen: Make Update or Publish Button Follow The Page
- Remove a plugin meta box from the dashboard
- How to make multicheck for post/page meta box
- Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types
- Second select list values are not saved after clicking update
- Replace the Post Excerpt Meta Box with a Field in My Custom Meta Box
- How to show post format gallery metabox image caption in the post front end
- Add custom buttons with custom actions in Edit Post screen in WordPress?
- Remove a metabox registered by another plugin – Woocommerce [closed]
- Possible to limit custom meta boxes depending on what page template is used?
- I’m confused about URL sanitization in meta boxes
- Add Slug Metabox to posts for contributors
- Hide meta box based on post format
- WPAlchemy: How to output values?
- save_post not working with attachments
- get $post (object,parts/values) in meta-box
- How to get meta box values – WP tuts tutorial
- Change Metabox Title
- add wp_editor to custom_meta_box
- Write automatic title at save_post (infinite loop)
- Show Meta Box On Specific Page Template
- Code run fast on a cronjob but slow with a do_action or ajax call
- Adding meta box without add_meta_box – is this bad?
- saving data entered into a Metabox into an array? for use with for/each output.
- Cusotm MetaBox content not getting saved
- How to get the meta box name and value
- My custom write panels won’t save data. What am I missing?
- meta box & callback function
- Custom Post Meta from custom metaboxes is randomly being deleted
- save_post action doesn’t passing post id to my function as argument
- $_GET & $post_ID
- WordPress ajax-action how to return content
- get_post_meta as a list for drop down search filter
- add_post_meta | update_post_meta | Via the frontend
- multi custom fields and taxonomy search
- Front end post and upload file, image for users without plugin
- Dynamic number of fields in a meta box
- How to make a metabox that contains link categories?
- unable to save custom taxonomy terms in a custom-built metabox in wp-admin
- Echo 2 values from one key in Array with get_post_custom
- meta box pop up upload button wont work
- Trigger action via button
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Metabox on a custom page – How to include the appropriate default scripts and styles?
- custom metabox nonce verification fails
- Extensible add_meta_box with apply filters
- Generating image sizes when uploading through wp.media
- Set post title to same value as a tow meta box
- add_post_meta Adds post meta but the value is blank
- Best practices for meta box placement?
- Echo order box (in pages)
- save post running twice and creating two database entries – how do I disable this?
- Tags meta box don’t show when creating a new post type
- where does my function output from load-* go?
- Remove Title, Editor and Meta Box Support Based on Post Formats
- Custom select box meta field
- Saving an upload media meta box field
- Is there a way to remove the Add boxes from the Screen Options menu metabox?
- How to get variable from other function inside class function using add_action for Ajax call