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:
parent
8842eba972
commit
d989b8e402
@ -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.' ),
|
||||||
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,6 +72,7 @@ class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase
|
|||||||
'posts_per_page',
|
'posts_per_page',
|
||||||
'default_ping_status',
|
'default_ping_status',
|
||||||
'default_comment_status',
|
'default_comment_status',
|
||||||
|
'permalink_structure',
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( ! is_multisite() ) {
|
if ( ! is_multisite() ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user