From 1b0856aff3d5bbf8ce3fe028691ecce25516b264 Mon Sep 17 00:00:00 2001 From: SergeyBiryukov Date: Wed, 29 Jun 2022 13:48:14 +0000 Subject: [PATCH] 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: * [https://github.com/WordPress/gutenberg/pull/38607 #38607 Page for Posts: Display notice in template panel] Props Mamaduka, spacedmonkey, gziolo, jameskoster. See #56058. Built from https://develop.svn.wordpress.org/trunk@53588 --- wp-includes/option.php | 31 +++++++++++++++++++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/wp-includes/option.php b/wp-includes/option.php index 12f70fef04..def80ed18f 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -2063,6 +2063,7 @@ function set_site_transient( $transient, $value, $expiration = 0 ) { * does not encompass all settings available in WordPress. * * @since 4.7.0 + * @since 6.1.0 The `show_on_front`, `page_on_front`, and `page_for_posts` options were added. */ function register_initial_settings() { register_setting( @@ -2220,6 +2221,36 @@ function register_initial_settings() { ) ); + register_setting( + 'reading', + 'show_on_front', + array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'What to show on the front page' ), + ) + ); + + register_setting( + 'reading', + 'page_on_front', + array( + 'show_in_rest' => true, + 'type' => 'number', + 'description' => __( 'The ID of the page that should be displayed on the front page' ), + ) + ); + + register_setting( + 'reading', + 'page_for_posts', + array( + 'show_in_rest' => true, + 'type' => 'number', + 'description' => __( 'The ID of the page that should display the latest posts' ), + ) + ); + register_setting( 'discussion', 'default_ping_status', diff --git a/wp-includes/version.php b/wp-includes/version.php index a93ebc20b7..a59e542614 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53587'; +$wp_version = '6.1-alpha-53588'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.