getEditedPostAttribute("meta") in Custom Post Type Returns Undefined #17018
Labels
Needs Technical Feedback
Needs testing from a developer perspective.
[Package] Data
/packages/data
REST API Interaction
Related to REST API
Describe the bug
I registered a custom posttype and set it "show in rest"
JS:wp.data.select( 'core/editor' ).getEditedPostAttribute('meta')
this returns undefied, it shoud always returns an Object.
To reproduce
Steps to reproduce the behavior:
register_post_type('my_posttype',array( 'labels' => array( 'name' => 'My PostType', ), 'public' => true, 'show_in_rest'=>true, ));
register_post_meta('my_posttype','meta_name',array( 'show_in_rest' => true, 'single' => true, 'type' => 'string', ));
wp.data.select( 'core/editor' ).getEditedPostAttribute('meta')
Expected behavior
JS :
wp.data.select( 'core/editor' ).getEditedPostAttribute('meta')
Should returns a Object like:
{ meta_name: '' }
Screenshots
![1](https://user-images.githubusercontent.com/26618275/62908757-399b1480-bdac-11e9-9969-7a0ab75c700a.jpg)
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
6.2.0
The text was updated successfully, but these errors were encountered: