Options/Meta: Document valid types for registration.

In 4.7, the REST API introduced types for options and meta passed into the registration functions. This adds the documentation for those types.

Props iandunn, priyankabehera155.
Fixes #40318.


git-svn-id: https://develop.svn.wordpress.org/trunk@40603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan McCue 2017-05-10 06:09:36 +00:00
parent faa6386ca0
commit f6b507f6a8
2 changed files with 2 additions and 0 deletions

View File

@ -974,6 +974,7 @@ function sanitize_meta( $meta_key, $meta_value, $object_type ) {
* Data used to describe the meta key when registered.
*
* @type string $type The type of data associated with this meta key.
* Valid values are 'string', 'boolean', 'integer', and 'number'.
* @type string $description A description of the data attached to this meta key.
* @type bool $single Whether the meta key has one value per object, or an array of values per object.
* @type string $sanitize_callback A function or method to call when sanitizing `$meta_key` data.

View File

@ -1871,6 +1871,7 @@ function register_initial_settings() {
* Data used to describe the setting when registered.
*
* @type string $type The type of data associated with this setting.
* Valid values are 'string', 'boolean', 'integer', and 'number'.
* @type string $description A description of the data attached to this setting.
* @type callable $sanitize_callback A callback function that sanitizes the option's value.
* @type bool $show_in_rest Whether data associated with this setting should be included in the REST API.