Registering default values for meta data

Registering default values for meta data

Author: WordPress.org

Date: August 4, 2020 

Category: Make WordPress Core

wprssaggregator Registering default values for meta data

With WordPress 5.5, the register_meta() functions ( including register_post_meta() ) now support registering default values. Previously it was only possible to register default values for the REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”) https://developer.wordpress.org/rest-api/. schema like this:

register_meta( 'post', 'greeting', array( 'single' => true, 'type' => 'string', 'show_in_rest' => array( 'schema' => array( 'type' => 'string',

This is the first part of the original article by WordPress.org.
Click here to read the full article in a new tab!


Registering default values for meta data

World of WordPress is hosted by:

Servebolt: next level high performance hosting.

While others try to add more components to their hosting to make it go faster, we decided to build our hosting cloud fast from the ground up. We did so by stripping out everything we knew was deadweight.


toolset logo tag line white Registering default values for meta data