From 3ecfb4b222e55b8e064c1b56b7b7030bc4fc940d Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Wed, 10 May 2017 06:10:43 +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. Built from https://develop.svn.wordpress.org/trunk@40603 git-svn-id: http://core.svn.wordpress.org/trunk@40473 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/meta.php | 1 + wp-includes/option.php | 1 + wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/meta.php b/wp-includes/meta.php index cfb9d95a9e..a9e8f987f9 100644 --- a/wp-includes/meta.php +++ b/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/wp-includes/option.php b/wp-includes/option.php index 8bc8edc932..9f7cc8698e 100644 --- a/wp-includes/option.php +++ b/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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 5192b322fd..a3c4bceba3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40602'; +$wp_version = '4.8-alpha-40603'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.