diff --git a/wp-includes/option.php b/wp-includes/option.php index 866cbcc480..3e29c578f0 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -1781,7 +1781,7 @@ function register_initial_settings() { register_setting( 'general', 'start_of_week', array( 'show_in_rest' => true, - 'type' => 'number', + 'type' => 'integer', 'description' => __( 'A day number of the week that the week should start on.' ), ) ); @@ -1803,7 +1803,7 @@ function register_initial_settings() { register_setting( 'writing', 'default_category', array( 'show_in_rest' => true, - 'type' => 'number', + 'type' => 'integer', 'description' => __( 'Default category.' ), ) ); @@ -1815,7 +1815,7 @@ function register_initial_settings() { register_setting( 'reading', 'posts_per_page', array( 'show_in_rest' => true, - 'type' => 'number', + 'type' => 'integer', 'description' => __( 'Blog pages show at most.' ), 'default' => 10, ) ); diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php index 0f1ead65f2..5d16fb396e 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php @@ -132,6 +132,8 @@ class WP_REST_Settings_Controller extends WP_REST_Controller { switch ( $schema['type'] ) { case 'string': return (string) $value; + case 'integer': + return (int) $value; case 'number': return (float) $value; case 'boolean': @@ -258,7 +260,7 @@ class WP_REST_Settings_Controller extends WP_REST_Controller { * Whitelist the supported types for settings, as we don't want invalid types * to be updated with arbitrary values that we can't do decent sanitizing for. */ - if ( ! in_array( $rest_args['schema']['type'], array( 'number', 'string', 'boolean' ), true ) ) { + if ( ! in_array( $rest_args['schema']['type'], array( 'number', 'integer', 'string', 'boolean' ), true ) ) { continue; } diff --git a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php index a85424e467..2c765caeaa 100644 --- a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php +++ b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php @@ -404,6 +404,9 @@ abstract class WP_REST_Meta_Fields { case 'string': $value = (string) $value; break; + case 'integer': + $value = (int) $value; + break; case 'number': $value = (float) $value; break; diff --git a/wp-includes/version.php b/wp-includes/version.php index 3e43ade385..7f3f9e0175 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta1-39057'; +$wp_version = '4.7-beta1-39058'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.