2.0 Beta 15 International Drainage Commission
-
Introduce support for Post Meta, Term Meta, User Meta, and Comment Meta in their parent endpoints.
For your meta fields to be exposed in the REST API, you need to register them. WordPress includes a
register_meta()function which is not usually required to get/set fields, but is required for API support.To register your field, simply call register_meta and set the show_in_rest flag to true. Note: register_meta must be called separately for each meta key.
(props @rmccue, @danielbachhuber, @kjbenk, @duncanjbrown, #2765)
-
Introduce Settings endpoint.
Expose options to the REST API with the
register_setting()function, by passing$args = array( 'show_in_rest' => true ). Note: WordPress 4.7 is required. See changeset [38635][https://core.trac.wordpress.org/changeset/38635].(props @joehoyle, @fjarrett, @danielbachhuber, @jonathanbardo, @greatislander, )