This can easily be done with default PHP functions.
// Loop through all fields, grab the content and assign it to a new array
foreach ( get_post_custom() as $custom )
$new_custom[] = array_shift( $custom );
// Get rid of empty fields
$new_custom = array_filter( $new_custom );
Related Posts:
- WordPress Action Hooks and Post ID?
- get_post_meta of multiple posts?
- How do I retrieve the slug of the current page?
- Most efficient way to get posts with postmeta
- Get posts by meta value
- what is the correct way to compare dates in a WP query_posts meta_query
- Explanation of update_post_(meta/term)_cache
- How to extract data from a post meta serialized array?
- Can I exclude a post by meta key using pre_get_posts function?
- Advanced search form with filters for custom taxonomies and custom fields
- How to update custom fields using the wp_insert_post() function?
- Can wp_query return posts meta in a single request?
- How to save an array with one metakey in postmeta?
- WordPress is stripping escape backslashes from JSON strings in post_meta
- How can I get the post ID from a WP_Query loop?
- Custom post meta field effect on the performance on the post
- Check if Post Title exists, Insert post if doesn’t, Add Incremental # to Meta if does
- How to get custom post meta using REST API
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- What is the index [0] for on post meta fields?
- What is “meta_input” parameter in wp_insert_post() used for?
- How to update_post_meta value as array
- Adding meta tag without plugin
- How to enable revisions for post meta data?
- What’s the point of get_post_meta’s $single param?
- The “_encloseme” Meta-Key Conundrum
- What is the different between an attachment in wp_posts and an attachment in wp_postmeta?
- Best way to programmatically remove a category/term from a post
- How to edit a post meta data in a Gutenberg Block?
- Sanitizing integer input for update_post_meta
- post formats – how to switch meta boxes when changing format?
- Using get_post_meta with new_to_publish
- Execute action after post is saved with all related post_meta records (data)
- Lack of composite indexes for meta tables
- Custom field values deleted when trashing custom post type
- How to get all custom fields of any post type
- Get a single post by a unique meta value
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- if get_post_meta is empty do something
- How we get_post_meta without post id
- How get post id from meta value
- What is the code to get the download link for a product in WooCommerce?
- Safe to delete blank postmeta?
- Custom field metabox not showing in back-end
- How do I Paginate Search Results for Custom Post Types?
- So much data in postmeta
- advanced custom fields update_field for field type: Taxonomy
- update_post_meta not saving when value is zero
- Can I count the number of users matching a value in a multiple value key?
- Content hooks vs User hooks
- Meta compare with date (stored as string) not working
- Getting attachments by meta value
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- How to hide meta box values from custom fields list?
- Auto sort the wp-admin post list by a meta key
- Trying to get custom post meta through Jetpack JSON API [closed]
- How to update/insert custom field(post meta) data with wordpress REST API?
- get_post_meta() unserialize issue – returns boolean(false)
- What is the advantage of the wp_options design pattern?
- meta_query where value is equal to given value
- Restrict post edit/delete based on user ID and custom field
- Storing meta fields multiple times OR once with multi dimensional array?
- Update all posts automatically when using post_meta
- Allow user to create instances of custom field
- get_post_meta returning empty string when data shows in the database
- publish_post action hook doesn’t give post_meta_data
- Remove WordPress.org Meta link
- Remove post meta keys
- How to access the post meta of a post that has just been published?
- Why time functions show invalid time zone when using ‘c’ time format?
- display specific custom fields
- Save metabox with multiple checkbox array
- Why is get_post_meta returning an array when I specify it as single?
- How Can I save multiple records in same meta key?
- Is there a hook / action that is triggered when adding or removing a post thumbnail?
- How to update/delete array in post meta value?
- How to get all term meta for a taxonomy – getting term_meta for taxonomy
- Adding an assisting editor box to Post page
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- How to display multiple Post meta_key/meta_values by SQL query
- Add options to featured image
- passing argument to get_template_part() or a better way to code
- Is it possible to store arrays in a custom field?
- Get updated meta data after save_post hook
- Detect meta value changes when post is updated (post_updated)
- Multiple meta values for same meta_key adding on “Preview Changes” hit but not on saving or updating post
- How to use multiple query with same meta key
- Save HTML formatted data to post meta using add_post_meta()
- delete unused postmeta
- Search everything (posts, pages, tags, cpt, meta)
- importing data from non-wordpress mysql db
- Should I sanitize custom post meta if it is going to be escaped later?
- Add post meta based on another post meta value before publish post
- Custom query with category exclusion and post-meta “whitelist”
- How do I retrieve multi-dimensional arrays from the wp_postmeta table, & display on a website?
- Front-end update_post_meta snippet displays white screen?
- Query between two meta values?
- Save both current and new version of post meta
- Get Advanced Custom Fields values before saving [closed]