Thanks to mmm’s comment above, it was pointed out that even for CPTs the first parameter’s value needs to be “post”, as clearly stated in the documentation at https://developer.wordpress.org/reference/functions/metadata_exists/.
Somewhere along the way I confused myself into thinking that the first parameter’s value needed to be the CPT handle for a custom post type (CPT), which was NOT correct. Thanks again mmm, and apologies for my oversight.
Related Posts:
- Check for update vs new post on save_post action
- How to avoid infinite loop in save_post callback
- $update is always true in save_post
- Action hook ‘save_post’ triggered when deleting posts
- get post meta before it is updated (during SAVE_POST)
- save_post action firing before I publish / save the post
- save_post action only when creating a new post
- Check if value has changed on save_post
- Minimum Word Count Before A Post Can Be Made Pending Review
- update_post_meta() not working in save_post
- How do I save each option in a multiple select menu as it’s own meta_key + meta_value pair?
- Update post on save
- Post meta checkbox becomes unchecked occasionally
- Return code from save_post action?
- update_post_meta not working in save_post
- save_post only saves meta data on second save
- Get Post ID with insert/edit link
- How to manage saving custom field from Quick edit and Post Save using save_post action hook without colliding each other?
- Why save_post_$(custom_post_type) is fired even if I am not already saving a post?
- Set the value of custom field when post is published or updated
- pass error to admin_notices on “quick edit”/save_post action
- save_post requiere at least one uploaded file to be published
- Get $_POST & $_REQUEST values before adding/updating post
- How can I create a new user account while creating a new post, and then set that new user as the author of that new post?
- Validate post checking if child term is assigned
- Clear cache on post of one type when something happens to post of other type
- Why not fire the save_post event?
- Compare custom taxonomies of updated post (or new post) [Updated with progress]
- WordPress 4.9.8 doesn’t save if content has style=”
- Reset all transients on post or page save
- Using PODS data with save_post
- Cant’t delete my custom posts
- where does this $post_id come from?
- Update current WP post every 3 minutes [closed]
- Changing new post to “pending” on publish – but “Publish failed” – why?
- update_post_meta not working in foreach
- Save post in another table
- Strange bug on post/page save
- draft_to_pending action doesn’t seem to fire
- What action to use for when a post is saved / published, with a caveat
- Custom wp_editor doesn’t update post_content
- Save custom value to main content of post
- Check for page template on save_post hook
- Access NEW/UPDATED post values in save_post() callback function
- save button grayed out randomly
- Post editor doesn’t save embed media [closed]
- How to get a post meta value and pass that to update_option when a post is created or updated?
- WordPress save meta data : Displaying the word Array when selected
- Save current post using custom save button
- Connection Reset on post/page save
- Meta data not saved on save_post
- Insert/Update DB table when making new post or update older one
- Prevent Page/Post From Being Created based on Pages/Posts per User per Time Unit
- How to debug | Some times the “Save Draft” button seems to spin but does not actually save
- My custom title gets duplicated at every save or post update
- Use save_post to generate file on wordpress
- Detect, if post is saved manually or programmatically in save_post-hook
- Check if new post or update before save_post action
- Using save_post to replace the post’s title
- Force post slug to be auto generated from title on save
- Hook to process a new taxonomy tag before it is created?
- How to verify nonce from Bulk/Quick Edit in save_post?
- Action ‘save_post’ not working for quick edit
- How to assign default taxonomy to pages on ‘save_post’?
- wp_insert_posts Fatal error: Maximum function nesting level of ‘100’ reached, aborting!
- Correct processing of `$_POST`, following WordPress Coding Standards
- Frontend posting – everything saves other than checkboxes?
- wp_insert_post_data filter not working correctly after upgrade to WordPress 5
- Strange issue saving custom field data for a WooCommerce order
- Why does post-slug not get saved for drafts?
- WordPress custom admin notice still displays after wp_insert_post_data validation
- How to notify specific users when i’m posting/modifying a new post
- Saving zero as meta value
- Run a function on all posts
- Dynamically set taxonomy term and show admin notice on post save
- Stripping URLs & Email from post submissions
- Change auto post title generation according to different post properties
- Class property seems to lose scope, attached to save_post action?
- Editor meta box Showing but not saving
- save_post action inside a custom metabox class not working
- help intercepting save_post through plugin
- How to check post meta isset or not empty during publish/save post?
- Select input in metabox not updated
- Adding term to a custom taxonomy based on term from product category
- Add Tag to post after publishing
- Post and Pages section inside WordPress admin are completely blank
- woocommerce_product_quick_edit_save hook not fired
- add_action(‘the_content’, ‘my_plugin_content’) is null
- preg_replace style attr in $content and Editing post_content before saving
- Generate post title and permalink from custom field and post date
- How to hook save-post function to use taxonomy term in post-slug?
- set_post_format called after wp_update_post when using bulk edit?
- WP_Query within save_post doesn’t include the item that triggered the action?
- Problem with ‘save_post’ hook not running
- save_post not called in plugin / custom field still saving overwriting metaboxes
- save_post action not firing when save
- Out of Memory – Line 791 of WP-DB.php (mysql_real_escape_string)
- Wp doesn’t save meta box data
- UI does not show correct Slug after modified using save_post action
- Get category of post inside save_post hook