From f6b507f6a8664b761ee1949ccb82b01aaa35906c Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Wed, 10 May 2017 06:09:36 +0000 Subject: [PATCH] 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 --- src/wp-includes/meta.php | 1 + src/wp-includes/option.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php index cfb9d95a9e..a9e8f987f9 100644 --- a/src/wp-includes/meta.php +++ b/src/wp-includes/meta.php @@ -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. diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index 8bc8edc932..9f7cc8698e 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -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.