You should use register_meta to add the meta field to the rest controller. Here the example from the link to expose the field my_meta
of the custom post type my_article
:
register_meta('post', 'my_meta', [
'object_subtype' => 'my_article',
'show_in_rest' => true
]);
Related Posts:
- Trying to get custom post meta through Jetpack JSON API [closed]
- Custom fields with value not pushing with wp_remote_post to wp site
- WordPress is stripping escape backslashes from JSON strings in post_meta
- WP REST API only returning partial list of users
- post formats – how to switch meta boxes when changing format?
- Fetch All Posts (Including Those Using a Custom Post Type) With WordPress API
- Adding an assisting editor box to Post page
- WP REST API “rest_no_route” when trying to update meta
- Cannot edit post meta fields with rest API
- Implementing the wp json-rest api
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- Metabox Data not being saved [closed]
- Increase the page size of the WordPress REST API
- Is it possible to update a post meta field through REST API if the format of it when registered is nested?
- Keep user’s privileges on accessing contents in JSON response
- Mass importing json data into custom fields (postmeta)
- How can I cache WordPress Rest API Response
- Why aren’t tags and categories added in post request to WP Rest API
- Update Line Item Meta Data – WooCommerce API
- WordPress REST API not returning all posts
- Unknown characters added to meta data values
- body_class REST field in WP-API
- Add Embed.ly API objects to post_meta on update
- Add box with custom per-page properties
- Is there a way I can fetch the WordPress Developer Code References with an API?
- How to properly use oneOf and anyOf in Rest Schema?
- How to clone all WordPress Rest API end points
- add post meta front end edit
- Cant create or update meta fields using WordPress REST API
- how to use nimble-API and Display data?
- I can not display meta value in extras.php and template-tags.php
- Bulk Update Post Meta Values from Different Post via Rest Api
- how to create JSON array [] for REST response?
- How to register post meta with multi level arrays?
- Add post meta data date to event
- exclude particular category in api
- Check if any meta on the post has value then display content
- How to receive JSON payload from a digital device
- WordPress API “code”:”rest_no_route” with Custom Route
- Get or set values in post meta
- WordPress output data to another website and pull data
- Loop through WordPress API response errors
- I created a Custom Meta Box but it is not displaying the value on my post page
- update_post_meta() throws Uncaught error: Cannot create duplicate attribute
- Autotrader API Integration
- Attachment metadata has value of ‘1’
- REST API get featured image source for custom post type
- Rest WP_Error always return null
- I would like to retrive JSON value and display it in wordpress page or widget
- Why does “if statement” has to “die()”, otherwise wont work?
- How to create REST Based JSON API(how to modify the code below)?
- Best way to make a JSON API from WordPress?
- WP-API + JS Backbone client – how to update post meta
- Make Custom Fields Public in JSON – API
- Remove action of an external plugin after checking if custom post meta is set
- How we insert values into database using metabox WordPress?
- REST API custom endpoints for metaboxes
- Post meta box data not saving
- Transmit headers and footers via API from one site to another
- Filtering Tabs in a Custom Post Type’s Edit Page
- Hide individual page title using checkbox in custom meta box?
- Adding post thumbnail URL in Search or Post REST APIs response [closed]
- Custom Fields help
- Cache metadata for set of posts
- Does post-meta belong in header?
- When editing a post with a custom meta box the values aren’t displaying correctly
- How to make certain content of the post noindex and no follow. not entire post?
- How to update post meta with xml data
- Post AND page parameter for WP function
- How to display meta box data using “Meta boxes as needed”
- Export posts with postmeta without ID?
- get_children filter with postmeta
- Why values dont shows in custom post column?
- Metadata in loops
- get_post_meta of multiple posts?
- How to login via wordpress api and get user details?
- multi-language multi-site with REST API
- Passing form data via AJAX to REST API And displaying results
- WP-API : post_meta not updated… but have another entry
- Allow iframe in custom meta box
- Counting number of identical meta keys
- Calling Data from Custom Meta Box
- Parse error thrown by get_post_meta [closed]
- How can I display my meta value in a textarea? [closed]
- delete blank space in post_meta empty [closed]
- WordPress REST API not displaying all information
- How can i remove blank area caused by theme’s post meta boxes?
- wp_postmeta store multiple values in one key [closed]
- Auto save title as custom meta field value
- How to get all the related ids without array?
- WordPress API standard compliance and specification for external database [closed]
- Rest API does not work after changing WordPress Theme
- Use a Variable in update_post_meta as the $meta_key
- Datepicker altField and altFormat to save a new meta key/value in a post?
- I am stuck between post meta function to call unique id
- WooCommerce REST API endpoints don’t exist
- query with custom field
- Problem with get_post_meta
- Using Form to alter PHP variable [closed]
- how to know that a wordpress plugin support using API?