Make WordPress Core

Changeset 53589


Ignore:
Timestamp:
06/29/2022 02:15:57 PM (22 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r53588 r53589  
    22372237        array(
    22382238            'show_in_rest' => true,
    2239             'type'         => 'number',
     2239            'type'         => 'integer',
    22402240            'description'  => __( 'The ID of the page that should be displayed on the front page' ),
    22412241        )
     
    22472247        array(
    22482248            'show_in_rest' => true,
    2249             'type'         => 'number',
     2249            'type'         => 'integer',
    22502250            'description'  => __( 'The ID of the page that should display the latest posts' ),
    22512251        )
  • trunk/tests/qunit/fixtures/wp-api-generated.js

    r53588 r53589  
    96369636                        "page_on_front": {
    96379637                            "description": "The ID of the page that should be displayed on the front page",
    9638                             "type": "number",
     9638                            "type": "integer",
    96399639                            "required": false
    96409640                        },
    96419641                        "page_for_posts": {
    96429642                            "description": "The ID of the page that should display the latest posts",
    9643                             "type": "number",
     9643                            "type": "integer",
    96449644                            "required": false
    96459645                        },
Note: See TracChangeset for help on using the changeset viewer.