As kaiser pointed out, you need to use the save_post
hook to call your save_my_metadata()
function.
See this code sample for a complete example of saving (and validating) metabox data:
https://github.com/Veraxus/nv-example-meta-box/blob/master/init.php
Related Posts:
- How do I remove all the metaboxes for a custom post type?
- Get all posts from custom post type and insert in select input as metabox
- Detect meta value changes when post is updated (post_updated)
- Having trouble with custom post type / meta box
- How can I include meta box content when searching?
- update a post meta from a single table cell TablePress
- update custom post type meta from a shortcode
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Displaying Meta Box Image
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- How to add multiple featured image in meta box in post editor?
- Show metabox in custom-post-template depending on taxonomy term?
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Displaying custom posts only if custom meta box’s date is not expired
- Displaying Metabox value (custom post type taxonomy)
- How can I display my custom metaboxes on a custom post template?
- Meta Box Only in CPT Edit Page, Not in Add New
- get_post_meta is returning image id
- Populate Custom Fields in a Custom Post Type?
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- Populate dropdown from one custom post type inside another custom post type
- How to check if user meta field is empty in conditional else statement
- A better way to add a meta box to custom post types
- Metabox not show in categories custom post type cmb2
- Show Custom Post Type meta boxes only on Page Edit
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Meta Data for Custom Post Type not saving
- create custom meta box with default value
- Displaying a div from an assigned meta_value when on a page
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Why do I have to press the “Update” button twice to save my meta box values?
- Values from meta-box not on $_POST
- Custom post type suddenly stoped working after WordPress 5 update
- How can I output WPAlchemy repeating fields meta values in my page template?
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Save Metabox Custom Field Value
- Meta box data not saving
- WP_Meta_Query object with conditionals
- Related posts meta_query CPT
- Meta box with front-end styling
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Add a class to post_class if more than one post shares same meta_value_num
- Function to return values from metabox
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Custom Meta Box with variable number of fields
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Get meta values from parent post and save in child post
- Metaboxes in Loop
- Custom meta box data not saving
- Collect custom post in a calendar
- Delete custom post type metadata without deleting the post in admin area
- Problem with ‘save_post’ hook not running
- Edit post meta direct from post.php?
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Display a post count from a custom metabox selection
- Post AND page parameter for WP function
- Use a Variable in update_post_meta as the $meta_key
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- Meta query with boolean true/false value
- How to force one column layout on custom post type edit page?
- Custom Post Type – Taxonomy Dropdown Menu?
- How to add multiple images to custom post type?
- How To Set Custom Post Type Title Without Supports
- Creating a Custom Post Types dropdown in a Meta Box
- Add pre-existing meta box to new custom post type
- WordPress Admin Panel search posts with custom post meta values along with title
- WordPress metabox file upload in custom post [duplicate]
- Timepicker-addon doesn’t show – Datepicker works fine?
- WordPress custom meta field for custom post not storing data
- List all images from a single post meta value
- Update Post Meta for a logged in user
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Adding a metabox on a CPT’s submenu page
- Ordering values entered in Custom Taxonomies
- Getting thumbnails of a custom posts featured images in a page-templates metabox
- Permalinks: custom structure for taxonomy – tags?
- Custom Post Type & Meta Box – Displaying meta box information on front end?
- how to show records that don’t have custom meta value
- link featured image to external link
- Showing a meta box in a custom post type on a page
- Having Issue on Getting Metabox Checkbox Value
- List of all posts in one custom post type in the edit screen of another
- Filter search posts by post meta?
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- Attaching more than 1 parent (Post) to a media file
- Order posts by meta value hiding posts instead of re-ordering
- custom search results – order results differently by post type
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- get_post_meta for Custom Post Type ( CPT )
- Meta box not saving
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Add multiple custom meta boxes to different custom post types
- Custom post type Featured Image popup not working
- Problems with a custom meta_box
- Custom Form Data save after Login User