Skip to content

Commit

Permalink
REST API: Add missing options to the settings endpoint.
Browse files Browse the repository at this point in the history
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:
* [WordPress/gutenberg#38607 #38607 Page for Posts: Display notice in template panel]

Props Mamaduka, spacedmonkey, gziolo, jameskoster, SergeyBiryukov.
Merges [53588] and [53589] to the 6.0 branch.
See #56058.
Built from https://develop.svn.wordpress.org/branches/6.0@53590


git-svn-id: http://core.svn.wordpress.org/branches/6.0@53178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
VenusPR committed Jun 29, 2022
1 parent ce4b0a1 commit b8284e6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions wp-includes/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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' => 'integer',
'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' => 'integer',
'description' => __( 'The ID of the page that should display the latest posts' ),
)
);

register_setting(
'discussion',
'default_ping_status',
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0.1-alpha-53569';
$wp_version = '6.0.1-alpha-53590';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit b8284e6

Please sign in to comment.