From 389283f5bdf014df011f48dc78e1edcf6a234d1b Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Sun, 3 Dec 2017 22:29:45 +0000 Subject: [PATCH] REST API: Include permalink_structure in the settings route. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are situations where the REST API client wants to be able to read and set the permalink_structure option. Though this doesn’t fix the use case of front-end rendered unauthenticated websites, it still has utility as a setting in it’s own right. Props aduth. See #41014. Built from https://develop.svn.wordpress.org/trunk@42359 git-svn-id: http://core.svn.wordpress.org/trunk@42188 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/option.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/option.php b/wp-includes/option.php index 265b0bdbe0..f8f3180d5c 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -2020,6 +2020,11 @@ function register_initial_settings() { ) ); + register_setting( 'permalink', 'permalink_structure', array( + 'show_in_rest' => true, + 'type' => 'string', + 'description' => __( 'Custom URL structure for permalinks and archives.' ), + ) ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 4e29e3fc3e..9405406535 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42358'; +$wp_version = '5.0-alpha-42359'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.