get_post_meta()
calls get_metadata(), the parameter description of which says:
$single
(bool) (Optional) If true, return only the first value of the specified meta_key. This parameter has no effect if meta_key is not specified.Default value: false
So, since you are passing ''
as the meta_key, the $single
parameter is ignored.
Does that explain it?
Edit:
If you only want the 1st value for each meta key, then just do the following:
array_map ('array_shift', get_post_meta (get_the_ID (), '')) ;
Related Posts:
- Explanation of update_post_(meta/term)_cache
- How can I get the post ID from a WP_Query loop?
- Adding meta tag without plugin
- What is the different between an attachment in wp_posts and an attachment in wp_postmeta?
- How to edit a post meta data in a Gutenberg Block?
- Sanitizing integer input for update_post_meta
- if get_post_meta is empty do something
- Remove WordPress.org Meta link
- How do I retrieve multi-dimensional arrays from the wp_postmeta table, & display on a website?
- Give extra post-meta to RSS feeds
- Can’t translate the post meta data (Date) in another language
- adding a URL to a post meta
- Short of raw SQL, can I query for multiple attachment metadata that have a given array key?
- get_post_custom()
- Problem With Order Item Meta In Woocommerce
- Mass importing json data into custom fields (postmeta)
- Best way to save postmeta
- How to echo get_post_meta (Fluent-Framework)
- How to add meta data to WordPress posts?
- How to update Post Meta values through the comment system
- Filtering multiple meta_values
- How add post_meta from user_meta?
- How can I get my iFrame to work with url from post_meta?
- get_post_meta remains empty while looping all menu items and using the ID
- how do I set a schedule event to modify all posts’s meta value weekly or monthly?
- How to stop wp_postmeta from being called on archive and search pages?
- How to use update_post_meta() function properly?
- WordPress front-end media (image) upload ERROR!
- running function during post save and adding variable to post meta
- update_post_meta saves nothing in database when run in publish_post
- Can’t access post meta on new post creation (cpt)
- How do I dynamically call a page/post author into the meta data?
- Set Condition echo function get_post_meta
- Custom post meta values reset by autosave [duplicate]
- Compare meta_query with a Regular Expression and do a less-than operation on it
- Is it possible to retrieve a post and its metadata at the same time?
- cleaning up safely wordpress wp_postmeta table
- Read post meta values, only if posts are public
- Post meta as array looks like string instead of array
- Why does get_transient() always return string even if integer set?
- Author_meta ONLY if it exists
- Time & Date on Post – Time Ago Custom Function
- How to test the outcome of a wpdb query?
- Mass removing CSS from 1,700 post [closed]
- Help with Post Meta
- How do I manage custom meta in post revisions in the Block Editor era?
- Generate metadata for cloud images
- Is there a way to disable post meta caching for development?
- Insert multiple metas in one time
- How to extract data from a post meta
- count post meta values
- Correct meta of Writing Meta Tags
- Get post_meta from specific post [closed]
- How to add tags to post from frontend?
- update_post_meta not working?
- Change wordpress meta tag description using WP functions
- getting the post_id from the post_meta
- troubles with get_post_meta (and saving it)
- Cant create or update meta fields using WordPress REST API
- Filter posts by meta key
- Display current ranking of post as a number in post title
- delete duplicates wp_postmeta
- Post Thumbnail missing when using webp format while sharing
- How to merge the array values in foreach?
- Bulk Update Post Meta Values from Different Post via Rest Api
- update_post_meta() is not saving the value
- Only show meta on one post type on search results page
- How to register post meta with multi level arrays?
- If I disable screen options, does WP still try to update post meta?
- update_post_meta not working with transition_comment_status
- Can we have duplicate key pair values in post meta data?
- I created a Custom Meta Box but it is not displaying the value on my post page
- Meta data being pulled from wp-login.php
- Is it possible to pass an whole array using custom field in wordpress?
- Attachment metadata has value of ‘1’
- Get post content before rendering
- wp_insert_post inside save_post adds wrong metadata to inserted post
- Rename image filename using ‘media_handle_upload’
- How do I update a specific value within array in a products metadata?
- Update Post metafield of specific categories
- rendering open graph meta tags in wordpress
- Using Self Hosted Video URL With Custom Fields
- Restore deleted _thumbnail_id in postmeta table
- WP-API + JS Backbone client – how to update post meta
- Proper Way to Sanitize Meta Input
- update_post_meta returning false when called during init
- Hide the_meta if no value
- php wp_insert data on front using a form
- Updating post_meta when updating a setting with the Settings API
- How to show specific meta keys of all posts in admin panel?
- wp_schedule_event not working
- Media library orphans
- WordPress join posts with meta values of array type
- Cache metadata for set of posts
- How to make certain content of the post noindex and no follow. not entire post?
- Export posts with postmeta without ID?
- How can I display my meta value in a textarea? [closed]
- delete blank space in post_meta empty [closed]
- Auto save title as custom meta field value
- Problem with get_post_meta