Your issue is not with storage, it is with retrieval. get_post_custom()
is inconvenient and rarely used in practice.
get_post_meta()
is more common in practice. Note it has explicit argument to retrieve a single value, rather than array of values for a key (which WP can do too).
Related Posts:
- Get only used meta_values
- Get_post_custom not fetching value from array wordpress
- How to create content automatically when a post is published?
- Can the Next/Prev Post links be ordered by menu order or by a meta key?
- Get the ID of the latest post
- Custom Post type – how to get checkbox to update meta field to null
- How do I Paginate Search Results for Custom Post Types?
- List most recent image uploads, but only for specific custom post type
- Ordering posts having multiple post-meta date fields
- Get all authors with at least one post of ‘custom post type’
- How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
- functions.php conditional tag only for custom post type
- Grossly inefficient wordpress loops!
- How Do I Use WP_Query to Run This Database Query as Search Result?
- How to get only one category of custom post type?
- Custom post type category not displaying in custom post type
- How to make custom post meta wp_editor translatable?
- Get random custom posts from a custom post type
- How to add multiple featured image in meta box in post editor?
- update_post_meta() whenever custom post type is updated
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- How to best delete orphan wp_postmeta
- 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?
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Insert Multiple Post with Same Publish Button
- Undefined Variable – Custom Post Type Meta
- Ordering posts in Search & taxonomy by post_meta
- How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?
- 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
- Metabox not show in categories custom post type cmb2
- Custom fields for custom post type
- Show future events based on custom field AND order by date
- Number of posts in the archive
- create custom meta box with default value
- How to Echo Metadata Value in Currency Format
- populate array with 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
- How to detect that the save_post hook is calling the callback associated to the current edit post page only
- Return number of all custom posts type by author in all statuses
- Is it possible to use array_walk() to append terms to an array of posts?
- 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
- Group by custom field value (start and end times)
- 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?
- How to get custom post type title, excerpt, thumbnail and permalink by post ID?
- Echo custom post meta from options array
- Value of post meta dropdown is not showing in WordPress
- Get posts by category name
- WP_Meta_Query object with conditionals
- Trying to write shortcode with get_post_meta but isn’t working
- How to properly use Categories with Custom Post Types
- HM CMB: Post Select Field for CPT ID
- 4 posts per page from single category
- updating one custom meta field only
- Problem Saving Custom Post Type Meta Values
- Orderby meta_key/meta_value not displaying anything, am I overlooking anything?
- Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- Get all posts by many custom post types
- Show posts from WP Custom Post Type selected from a field in a metabox
- 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
- Query posts based on user preferences
- Add more custom fields when creating a new custom post type
- Stripe multiple transactions
- Decrement term in for each
- Edit is changing my custom’s post type parent id
- Disable Facebook Comments Automatically On CPT
- Popup panel is only displaying 1 entry ignoring all others
- Problem with ‘save_post’ hook not running
- WordPress custom post type
- Edit post meta direct from post.php?
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
- How can I give WordPress child custom post type the same title and slug as its parent?
- Change the contents of a dropdown through the admin panel?
- Top 30 Songs using Custom Post Type
- Advice Needed for Post Meta Database Efficiency
- fetch meta fields inside a widget
- Custom post type – update_meta not working
- How do I correctly query posts from a post ID?
- Use a Variable in update_post_meta as the $meta_key
- Display posts from another page on home page in wp-editor
- Add Category names to post lists of custom post type