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
- Best way to programmatically remove a category/term from a post
- advanced custom fields update_field for field type: Taxonomy
- delete unused postmeta
- Show the “ratingValue” and “ratingCount” values of KK Star Ratings Plugin
- Using radio button meta data from a custom meta box
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- metabox upload file
- Saving html into postmeta without stripping tags – safe?
- Repeatable custom meta fields
- special characters after saving draft interpreted as �
- “update_post_meta” not working in “wp_insert_post_data” hook
- How to create a meta_query to get all posts with a specific meta data?
- How to disable WordPress blog folder
- get_post_meta not extracting title,permalink and posttype
- Save post meta foreach loop
- Should I save this mulit dementional arary as one post meta?
- Difficultly changing date format in post meta value
- Remove last character in get_post_meta
- mass delete posts based on metadata
- How to obtain a group of post meta and assign each meta to other variables?
- Building a REST API for your web app exposes primary keys of DB records?
- Duplicate rows in meta table, any known relations in WC?
- update_post_meta in loop changing ALL values
- Why is my get_post_meta not properly calling the custom field when attempting to embed a YouTube video?
- How can I use ‘orderby’ => ‘meta_value_num’ to order by the numerical value even if the value starts with a word?
- How do I add a fixed value to get_post_meta();?
- get specific values from WordPress meta_value
- Is duplicate `_wp_attachment_image_alt` meta key allowed?
- DELETE request using WP REST API
- rest_cannot_create_user
- How to modify default meta link format
- update_post_meta doesn’t work
- REST API Working for GET but not for POST?
- Custom Meta Fields that are Echo’d are removed on post update?
- Save, update, get and sanitize post meta as HTML not plain
- How to add dynamic content in title and meta description in wordpress theme for homepage, post page, category, tag and pages
- WordPress AJAX load post metadata in modal
- Edit post meta direct from post.php?
- Looking for suggestions on creating simple database (Help!!)
- query with custom field
- Using Form to alter PHP variable [closed]
- how to know that a wordpress plugin support using API?
- External api call using wordpress