Use the third parameter of the get_post_meta()
.
If the third parameter is set to true then the function will return a single result, as a string. If false, or not set, then the function returns an array of the custom fields
for example:–
$froms = get_post_meta( 139, 'from', true );
$tos = get_post_meta( 139, 'to', true );
For more details look into the Codex here
Related Posts:
- Update Multiple Post Meta for the Same Post In One call?
- Comparisson between date() and a date from wp_postmeta
- Show the “ratingValue” and “ratingCount” values of KK Star Ratings Plugin
- Updating post meta for custom post types
- How can I add a custom meta value on file upload?
- How to get custom field image url of specific size
- How do I add advanced custom fields / meta fields to Elasticsearch? [closed]
- Set attached to state
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Add multiple attributes to product from php
- Make the checkbox meta field checked by default
- Where to hook my plugin’s action
- Is there a filter for get_post_custom()?
- dynamically generating plugin syntax
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Create digital-virtual-downloadable WooCommerce products from the frontend using Gravity Forms? [closed]
- What is generating my meta og:description?
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- How to display the “ratingValue” and “ratingCount” values generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
- get current date + 90 days and checking every day
- How can I change the meta_key for a particular piece of information?
- WordPress Post Visibility Options for Frontend
- Bulk update all posts from plugin settings screen
- Meta box losing its value when scheduled post is published
- How to insert multiple postmeta values with one query?
- Mass SQL WordPress Meta Key deletion
- Date format – Meta Box plugin
- How to remove bulk actions from custom post type
- Adding custom meta boxes to specified custom post type
- How to select a paragraph other than the 1st to be the post’s excerpt?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- How can I concatenate variables to search results title? [closed]
- Remember the Meta Value With Radio Buttons
- Link Posts to External URL
- Why does “updated_post_meta” did not fire when uploading media other than image?
- What snippet do I need to type to show my ACF field show up on my theme?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Help to Create a Simple Plugin to make a post
- get_post_meta shortcode returns empty field
- Add an action based on custom post meta field
- how to auto random increment for post view
- How to securely controlling data without keeping it in postmeta?
- “Enable Media Replace” plugin does not update serialized object in WPMeta
- Custom Field used to allow a Free Story; no longer works
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- Get and Update Most Meta Value as an array in HTML form
- How to create meta fields with more than 1 relation?
- Get value from an input field and pass into update_meta_data as $meta_value
- How to get post that has non zero or greater than zero meta value
- Delete postmeta when uninstall/delete plugin
- Same Title on two different post type with single custom taxonomy
- How can I make my plugin display custom post meta data on the front end?
- Storing values in Post Meta vs new tables
- Add meta tags with a plugin?
- WordPress User Frontend Editing Custom Fields
- wordpress last all added get meta value by post id
- Get post id in Post Page within Wp-admin
- Output plugin post like system count [closed]
- getting image alt text via ACF plugin in WordPress [closed]
- Update post meta Rest Api
- how to add meta for order in woocommerce
- How to disable Yoast meta description for all pages
- Force post update with React
- My WordPress site when down after installing a plugin and now all I get is a simple white screen [closed]
- How to pass the API key to the client from the database? [closed]
- Access a particular field in an array
- Notice: Uninitialized string offset: 0 in social sharing mu-plugin
- Override plugin styles via my custom theme
- Using ACF default value to autoincrement a number field
- Elementor: How to override global theme style settings? [closed]
- How to deploy gutenberg on my own [closed]
- Render Modula Plugin Shortcode On Ajax Request
- WPDB: Update table
- Shortcode to update user meta
- Add user role to generated plugin
- How to add CSS via custom plugin?
- Is there a way to get plugins and themes not built for multisite to work on a network subsite?
- }catch (ex){} showing in header [closed]
- How to prevent additional code in functions.php to be removed once there is an update?
- How to add custom table style for table block in gutenberg editor
- Update a core option from plugin settings page
- WordPress error: Options page Setting_ not found in the allowed options list
- Completely disabling password reset/recovery
- a href adds default URL with the given echo URL
- Why is my custom post type not being activated on plug-in activation?
- Disabling Wp_is_mobile from backend?
- One file for all translations
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- Send admin an email when a user’s search has no results
- Plugins fail to update: Download failed. A valid URL was not provided
- How to check if my wordpress websiste is nulled or not?
- Plugin settings won’t save changes
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- What is the right way to show reusable content
- URLs Added to ACF Repeater Field are not working
- WordPress Users authentication with Java Application
- How do I automatically generate pages from a database?
- custom post type don’t appear in the home page
- How to add apply_filter for a class property in plugin
- What is a rock solid development and deployment workflow? [closed]