REST API: Include permalink_structure in the settings route.

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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42359 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Hoyle 2017-12-03 22:28:33 +00:00
parent 8842eba972
commit d989b8e402
2 changed files with 6 additions and 0 deletions

View File

@ -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.' ),
) );
}
/**

View File

@ -72,6 +72,7 @@ class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase
'posts_per_page',
'default_ping_status',
'default_comment_status',
'permalink_structure',
);
if ( ! is_multisite() ) {