The issue is that you are using get_post_meta()
, but since you’re hooking wp_insert_post_data
you have not set the post meta yet (because the hook fires before the post is inserted into the database. You should be pulling from the metadata submission, and running through any filters you use for update_post_meta()
. If you post the code where you set the postmeta and comment back, I’ll try to write out some sample code (assuming you need it)
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
- 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
- Cannot Save MetaBox Data in Custom Post Type
- 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
- Remove Custom Taxonomy Metabox from Custom Post Type Screen
- How can I filter posts by post_parent in the admin?
- Changing the priority of a custom taxonomy’s metabox
- How to create a mini directory in WordPress?
- Search everything (posts, pages, tags, cpt, meta)
- Compare 3 custom fields and sort by oldest
- How to select one major category (or custom taxonomy) for a custom post type?
- Custom post type’s slug gets wrong when adding a custom meta box
- Can’t sort order of wp_query with 2 meta keys
- How to get source of custom meta image?
- How to add meta boxes(repeater fields) from WordPress back end?
- WordPress nl2br is not converting newline to html line break when saving metabox value
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Create custom PAGE with register_post_type
- Update CPT post meta with update_post_meta and cron job
- What’s the difference between same wp functions get_posts(); functions in different form?
- Custom Post Type with Templates using Meta Boxes?
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Create Connection Between two post types
- Listing custom terms in custom post meta
- Moving meta boxes in admin
- Get only used meta_values
- Can I restrict category availability?
- Setting Post Title via Meta Data returns Auto-draft
- How to insert data into meta box from another plugin?
- Save CTP post meta different values each day without overwriting previous values
- Publish box in CPT remove ‘edit’ link
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Where is get_post_meta value located?
- Custom post meta box as a sub form
- Storing data in a multidimensional array from dynamically generated foreach loop
- Custom meta-box for all custom post types
- Filter CPT based on meta box value using Flexible Posts widget?
- Querying meta values within an array
- why get_post_meta is returning 0?
- Save post_parent in a custom post type
- Show search for data extracted from metabox
- Changing to different post type maintains the redirection?
- How to consume external API from WordPress post editor and display the response data in the custom field?