When registering the Custom Post Type, ensure custom-fields is present in supports => array('editor','title', 'custom-fields')
. It’s the legacy wording of meta fields and is commonly mistakenly omitted when declaring supports in CPTs.
After you make the above change, your Team CPT should work with meta values. You still may encounter in Gutenberg initially, the meta values are ‘undefined’ as they don’t have a default value set. A default value can be set either when registering the Post Meta eg. 'default' => 'test string'
or in the block attributes.
NB. The documentation has been updated since this question was posted ref: trac #47866
Refer to the latest WordPress REST API to see all the changes
Related Posts:
- Transition from (classical) serialized custom meta field to (gutenberg) rest enabled meta
- How to save a ToggleControl value in a meta field?
- Custom Meta Box not Saving in Posts with Gutenberg Editor
- Looping inside block return
- Update post meta custom field using block editor
- WordPress Blocks, setAttributes not saving
- Custom meta POST request fired twice when updating a post in Gutenberg
- How to get custom post meta using REST API
- The “_encloseme” Meta-Key Conundrum
- Gutenberg add a custom metabox to default blocks
- Using get_post_meta with new_to_publish
- Can I count the number of users matching a value in a multiple value key?
- Auto sort the wp-admin post list by a meta key
- Allow user to create instances of custom field
- extend Meta Box / Document Panel
- getEntityRecord without knowing the post type
- Get updated meta data after save_post hook
- Save HTML formatted data to post meta using add_post_meta()
- How to break meta values into different items and avoid duplicates?
- ajax delete value from custom field array
- Save attachment custom fields on front end
- Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
- Custom field value based on other custom field values
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Saving custom image meta fields
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- How to display Meta Field Value?
- Combine multiple custom field values into single value
- How do I use wp_query for WordPress search?
- Nav Menu – Add class based on meta keys
- Can’t get post ID using wp_insert_post_data
- Unique Post Meta Values
- Possible to add a meta field for css attribute to the editor Advanced panel?
- Add new image block, set default class name and update it using Javascript
- Custom Field Values not updating unless I click “Update” twice
- How to create a shortcode to print specific values stored in a post meta array?
- Add custom field to all posts in specific post_type
- Trying to update_post_meta function
- Button inside Custom Meta Box triggering the Update Button
- How to load an assets based on custom field value?
- Custom WP_Query for WordPress Search Results with meta_query
- get_posts in meta box dropdown not showing latest posts
- Unique meta_key with array value vs repeated meta_key with single values
- Allow only one post with specific meta value
- wordpress custom loop ascending descending posts by custom field
- How to validate select field in post meta?
- How to display childrens custom fields?
- how to display custom fields of post on a web page
- Hide custom fields when empty
- How do I query the title (or handle?) of post meta fieldset (created with Simple Fields Plugin)
- Save all the post tags inside a custom field
- How to fill custom fields with brackets in their key with add_post_meta()?
- How add multiple wp_editor_box to new post
- change order of images attached to post
- Get YouTube video id from url in a custom field
- Related query shows same image in loop
- Can’t Output get_post_meta?
- put saved metabox values back into fields and then display on the front end
- How to get custom image field of specific post id
- get_post_custom_values problem, please help
- wordpress multi user question
- how to enable custom fields in the Gutenberg post editor
- How can I change author of posts to the value of one of the custom field of the posts?
- How to set up page fields with gutenberg instead of ACF
- Gutenberg add a custom metabox to default blocks
- Custom meta fields and meta keys
- How to improve my non-unique metadata MySQL entries?
- Saving Custom Field that includes Quotation marks
- Custom Fields Not Showing (ACF not installed)
- SQL query to change the value of a Custom Field
- Post meta data not showing in frontend, until hitting ‘update’ button
- searching by keywords in post’s metas or pagination links problem
- Add custom field information to source meta data
- How do I update custom field post meta in frontend post template?
- How to Find List of Available Custom Fields for Theme?
- update meta field value after
- Custom Fields Not Working In Footer
- ACF plugin and field update
- Delete custom meta
- Echo out custom fields in comments
- Search one custom field?
- Can’t save meta field value if the title not set
- Display Data From This Custom Media Upload Meta Box?
- Save values generated via API as custom meta fields
- Adding custom fields to images
- How to save dynamically generated value in post type?
- wordpress simple post multi rating with post_meta and user_meta
- update_post_meta not working in action hook
- how to show this part only in the single post page?
- Display meta data from a custom field within plugin Category Grid View Gallery
- Custom fields / meta box output
- If post custom meta data is not set, show normal state
- How do i output images from URL’s added to the same custom field key
- Colecting values from custom field checkboxes and displaying them in the post
- custom field with links
- add multiple values (array) to post meta_input
- How can i put a custom field inside this php
- save all acf options in one meta_value [closed]
- WP Query Args – search by meta_key or title
- Search for meta_query does not return any result if combined with title