On a whim I tried this: stop checking for a custom post object and just use save_post
. I’m able to get the data I need from save_post
without using save_post_type
. That is, I can run this:
add_action( 'save_post', array( $this, 'post_actions' ), 11, 2 );
And instead of only running that when the post type is post
, I can run it as long as it is not user
, attachment
, tag
, post_tag
, category
, or comment
.
So it doesn’t really answer the question of why save_post
and save_post_type
behave differently with regard to what data is available, but it does solve my immediate issue of my missing data.
Related Posts:
- update_post_meta() whenever custom post type is updated
- Trigger “unsaved changes” dialog for custom post meta changes
- How to detect that the save_post hook is calling the callback associated to the current edit post page only
- How to save post_status using action save_post?
- Custom meta box data not saving
- Problem with ‘save_post’ hook not running
- Can the Next/Prev Post links be ordered by menu order or by a meta key?
- Using save_post to replace the post’s title
- Prevent post from being published if custom fields not filled
- Custom Post type – how to get checkbox to update meta field to null
- How do I Paginate Search Results for Custom Post Types?
- Submitting posts from the front end – sanitizing data
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- Ordering posts having multiple post-meta date fields
- How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
- Grossly inefficient wordpress loops!
- Custom field values get deleted
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Change 2 fields in the post depending on the 3rd field before save
- Custom post type category not displaying in custom post type
- How to make custom post meta wp_editor translatable?
- How to add multiple featured image in meta box in post editor?
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Frontend posting – everything saves other than checkboxes?
- How to best delete orphan wp_postmeta
- Custom Post Custom Taxonomy Data Not Saving in Edit Screen
- How can I get_post_meta() in the most efficient way?
- Count posts with specific term_meta
- Custom search for custom post meta with pre_get_posts interferes with WP search
- WordPress Orderby Numeric Value Not Working
- Replace title column in post list with post meta value
- My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
- List all images from a single post meta value
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Insert Multiple Post with Same Publish Button
- Confusion regarding Nonce & using it in Custom Columns for Saving Checkbox Value to Post Meta
- Undefined Variable – Custom Post Type Meta
- Ordering posts in Search & taxonomy by post_meta
- Meta Key Value in current-user-only loop
- How to implement a Google map store locator
- Post image in WordPress not appearing on home page
- changing meta value and meta key of price field
- Posting to a Custom Post Type from front end – user generated content
- Getting meta in editor plugin, and event triggering issue
- Restrict Access to Posts based on Custom User and Post Meta Data
- get_post_meta returning no value in custom post type alert email
- Metabox not show in categories custom post type cmb2
- CPT Validation to not show “Post updated.”
- save_post custom post type ? $_POST not working?
- Custom fields for custom post type
- Show future events based on custom field AND order by date
- If Post Meta Equals Current Title Conditional Advanced Custom Fields
- create custom meta box with default value
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- delete_post_meta() for whole CPT / multiple posts?
- How to move a post to different post type with all meta data?
- Why do I have to press the “Update” button twice to save my meta box values?
- WP API Response does not show my registered metadata
- get_post_meta returns NULL in front-end, but correct result in back-end
- Problem with adding custom post type meta to header by plugin
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- How to call a post’s metadata in shortcode.php?
- Echo custom post meta from options array
- Value of post meta dropdown is not showing in WordPress
- WP_Meta_Query object with conditionals
- Trying to write shortcode with get_post_meta but isn’t working
- HM CMB: Post Select Field for CPT ID
- updating one custom meta field only
- Add a class to post_class if more than one post shares same meta_value_num
- Problem Saving Custom Post Type Meta Values
- Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
- Save post action is called twice
- Show posts from WP Custom Post Type selected from a field in a metabox
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Peepso: Add extra data field (custom post meta) to postbox
- Change picture attachment meta of all occurrences of a picture
- Unknown Post Meta Records
- Get Previous Post based on Custom Field Name, for Custom Post Type
- Saving custom post types post_meta over REST-API fails
- add action save post type and update post meta woocommerce
- get_post_meta not working with variable as a post_id for dynamically get the postid
- How to stop post status from reverting to Published?
- Linking posts together with Advanced Custom Fields “both ways”
- custom search results – order results differently by post type
- Stripe multiple transactions
- How to implement custom post type’s users
- How to get Current week and current date record wp query
- get_post_meta for Custom Post Type ( CPT )
- Edit is changing my custom’s post type parent id
- How to add post reference field to a plugin?
- WordPress custom post type
- Edit post meta direct from post.php?
- Custom Post Type meta oembed html output resulting in WSoD
- Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
- Change the contents of a dropdown through the admin panel?
- fetch meta fields inside a widget
- Custom post type – update_meta not working
- Custom Form Data save after Login User
- Use a Variable in update_post_meta as the $meta_key