[wp-trac] [WordPress Trac] #43392: Support 'object' and 'array' types in register_meta()

WordPress Trac noreply at wordpress.org
Tue Sep 17 23:37:47 UTC 2019

#43392: Support 'object' and 'array' types in register_meta()
 Reporter:  diegoliv                             |       Owner:
                                                 |  TimothyBlynJacobs
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.3
Component:  Options, Meta APIs                   |     Version:  4.9.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-unit-tests dev-feedback commit   |     Focuses:  rest-api
  needs-dev-note has-patch needs-docs            |

Comment (by TimothyBlynJacobs):

 Uploaded a patch that updates the documentation to mention object and
 array types are valid and that "show_in_rest" can be an array.
 `register_meta()` now issues a `_doing_it_wrong` when registering an
 `array` meta key that shows in the REST API and omits "items" in the

 > When registering an "array" meta type to show in the REST API, you must
 specify the schema for each array item in "show_in_rest.schema.items".

Ticket URL: <https://core.trac.wordpress.org/ticket/43392#comment:50>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list