From f1b3ce0902ec61c2c58be2683590d5e23e779666 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 29 Jun 2022 14:15:57 +0000 Subject: [PATCH] REST API: Use the `integer` type for `page_on_front` and `page_for_posts` options. This adjusts the newly added options in the settings endpoint to use the `integer` type instead of `number`. Since these are page IDs and are not supposed to be floats, `integer` is the correct type. Follow-up to [53588]. See #56058. git-svn-id: https://develop.svn.wordpress.org/trunk@53589 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/option.php | 4 ++-- tests/qunit/fixtures/wp-api-generated.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index def80ed18f..eeb751c04c 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -2236,7 +2236,7 @@ function register_initial_settings() { 'page_on_front', array( 'show_in_rest' => true, - 'type' => 'number', + 'type' => 'integer', 'description' => __( 'The ID of the page that should be displayed on the front page' ), ) ); @@ -2246,7 +2246,7 @@ function register_initial_settings() { 'page_for_posts', array( 'show_in_rest' => true, - 'type' => 'number', + 'type' => 'integer', 'description' => __( 'The ID of the page that should display the latest posts' ), ) ); diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index 654a0bee07..485746dbc2 100644 --- a/tests/qunit/fixtures/wp-api-generated.js +++ b/tests/qunit/fixtures/wp-api-generated.js @@ -9635,12 +9635,12 @@ mockedApiResponse.Schema = { }, "page_on_front": { "description": "The ID of the page that should be displayed on the front page", - "type": "number", + "type": "integer", "required": false }, "page_for_posts": { "description": "The ID of the page that should display the latest posts", - "type": "number", + "type": "integer", "required": false }, "default_ping_status": {