From b6a068440214f92bf4acb935334844134df3dab6 Mon Sep 17 00:00:00 2001 From: Mamaduka Date: Thu, 27 Feb 2025 03:39:25 +0000 Subject: [PATCH] REST API: Add the site reading options to the index. Exposes `page_for_posts`, `page_on_front` and `show_on_front` reading settings via REST API index. Props mamaduka, audrasjb, spacedmonkey, timothyblynjacobs. Fixes #63023. Built from https://develop.svn.wordpress.org/trunk@59880 git-svn-id: http://core.svn.wordpress.org/trunk@59222 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-server.php | 3 +++ wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 17d620f6fb..8fe9834a8d 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -1371,6 +1371,9 @@ class WP_REST_Server { 'home' => home_url(), 'gmt_offset' => get_option( 'gmt_offset' ), 'timezone_string' => get_option( 'timezone_string' ), + 'page_for_posts' => (int) get_option( 'page_for_posts' ), + 'page_on_front' => (int) get_option( 'page_on_front' ), + 'show_on_front' => get_option( 'show_on_front' ), 'namespaces' => array_keys( $this->namespaces ), 'authentication' => array(), 'routes' => $this->get_data_for_routes( $this->get_routes(), $request['context'] ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 28b6ab39c7..0cfba1c818 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59879'; +$wp_version = '6.8-alpha-59880'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.