Make WordPress Core


Ignore:
Timestamp:
06/29/2022 01:46:37 PM (4 years ago)
Author:
SergeyBiryukov
Message:

REST API: Add missing options to the settings endpoint.

This adds the show_on_front, page_on_front, and page_for_posts options to the settings endpoint that were missed during WP 6.0 backports.

Related PR from Gutenberg repository:

Props Mamaduka, spacedmonkey, gziolo, jameskoster.
See #56058.

File:
1 edited

Legend:

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

    r53490 r53588  
    20642064 *
    20652065 * @since 4.7.0
     2066 * @since 6.1.0 The `show_on_front`, `page_on_front`, and `page_for_posts` options were added.
    20662067 */
    20672068function register_initial_settings() {
     
    22222223
    22232224    register_setting(
     2225        'reading',
     2226        'show_on_front',
     2227        array(
     2228            'show_in_rest' => true,
     2229            'type'         => 'string',
     2230            'description'  => __( 'What to show on the front page' ),
     2231        )
     2232    );
     2233
     2234    register_setting(
     2235        'reading',
     2236        'page_on_front',
     2237        array(
     2238            'show_in_rest' => true,
     2239            'type'         => 'number',
     2240            'description'  => __( 'The ID of the page that should be displayed on the front page' ),
     2241        )
     2242    );
     2243
     2244    register_setting(
     2245        'reading',
     2246        'page_for_posts',
     2247        array(
     2248            'show_in_rest' => true,
     2249            'type'         => 'number',
     2250            'description'  => __( 'The ID of the page that should display the latest posts' ),
     2251        )
     2252    );
     2253
     2254    register_setting(
    22242255        'discussion',
    22252256        'default_ping_status',
Note: See TracChangeset for help on using the changeset viewer.