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]
- 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
- Hide individual page title using checkbox in custom meta box?
- Display Custom Meta Box Field Only If Value is Present
- Adding new value to existing meta key
- delete post meta by AJAX
- how to get a list of meta data fields assocaited with a custom post type
- merge wp rest api query to get posts per category does not work
- Custom API plugin to execute 3rd party API to retrieve data
- REST API and filtering by meta value
- Save meta data with post, Without using any plugin [closed]
- How to delete duplicate records in wp_postmeta database table?
- JSON API and notification about registration
- Get posts ordered by meta data
- Displaying values from related field – if empty shows current post type’s link and title
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- get_post_meta inside echo [closed]
- Custom fields or something else
- 403 error when publishing a post in wordpress. Error => Publishing failed. The response is not a valid JSON response
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- WordPress Theme/Plugin Information API Response to Text and Button
- if get_post_meta function returns empty – Do Not Display HTML
- I Can’t get the post_tag name from term_id using wp_set_object_terms
- How to update/add child posts meta whenever the parent post meta is updated?
- The REST API encountered an error in wordpress?
- why is my postmeta table is so heavy
- How to save one API response to WooCommerce order meta data
- Using a comma instead of a pipe to separate metadata
- Posting data from Ionic app to WordPress
- Multisite and the JSON REST API: How to?
- Custom meta box data not saving
- Saving custom fields for WP_Query to retrieve
- WP Rest API v2.0 user profile update issue
- Developing a plugin, ran it through P3 Profiler, shows up slow, but I don’t know why
- Sorting meta box values by start- and enddate and all dates in between
- Use an id on a button to update_post_meta in post
- Updating post meta and Meta Box plugin
- Custom Fields help
- How to get all the related ids without array?
- External api call using wordpress
- Server 500 error when updating post using block editor
- How to get attributes from a post requested via the JSON API?
- Add specific postmeta to search query
- retrieving external api data and updating existing custom post