REST API: Special case the “standard” post format to always be allowed.

Fixes #38916.

git-svn-id: https://develop.svn.wordpress.org/trunk@39353 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Hoyle
2016-11-24 00:07:50 +00:00
parent 7dc75c29f6
commit a1c2caa4e3
2 changed files with 33 additions and 1 deletions

View File

@@ -1908,7 +1908,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
$schema['properties']['format'] = array(
'description' => __( 'The format for the object.' ),
'type' => 'string',
'enum' => $supports_formats ? array_values( $supports_formats[0] ) : array(),
'enum' => array_merge( array( 'standard' ), $supports_formats ? array_values( $supports_formats[0] ) : array() ),
'context' => array( 'view', 'edit' ),
);
break;