mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-13 05:10:18 +00:00
REST API: Allow unsetting of page templates in update requests.
Sending a request to update a page with the template property set to an empty string resulted in an error because “” was not a valid value in the enum. Props lucasstark, swissspidy. Fixes #38877. git-svn-id: https://develop.svn.wordpress.org/trunk@39343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1928,7 +1928,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
$schema['properties']['template'] = array(
|
||||
'description' => __( 'The theme file to use to display the object.' ),
|
||||
'type' => 'string',
|
||||
'enum' => array_keys( wp_get_theme()->get_page_templates( null, $this->post_type ) ),
|
||||
'enum' => array_merge( array_keys( wp_get_theme()->get_page_templates( null, $this->post_type ) ), array( '' ) ),
|
||||
'context' => array( 'view', 'edit' ),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user