[wp-trac] [WordPress Trac] #40408: REST API (v2) Does not handle metadata

WordPress Trac noreply at wordpress.org
Thu Apr 20 13:07:10 UTC 2017


#40408: REST API (v2) Does not handle metadata
--------------------------+-----------------------------
 Reporter:  teamcoltra    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  WordPress.org
Component:  REST API      |     Version:  4.7.3
 Severity:  normal        |  Resolution:
 Keywords:  needs-codex   |     Focuses:  docs, rest-api
--------------------------+-----------------------------

Comment (by pissio):

 it seems to me that the expected process works only with standard posts.
 In case of custom post types (marked as show_in_rest => true) with proper
 register_meta (marked as show_in_rest => true as well), it doesnt work if
 you rely on standard PostsController. In Its constructor it instantiates
 an WP_REST_Post_Meta_Fields object with proper post_type. However, since
 method get_meta_type returns "post" instead of proper post_type,
 get_registered_meta_keys returns wrong values when called by
 WP_REST_Meta_Fields::get_registered_fields. If
 WP_REST_Post_Meta_Fields::get_meta_type returned post type as passed in
 the contructor, everything would have worked...

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40408#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list