Skip to content

Commit

Permalink
Simplify the format array in get_item_schema
Browse files Browse the repository at this point in the history
Change the type to a string that matches the format slugs.
Each post can only have one format.
  • Loading branch information
carolinan committed Aug 22, 2024
1 parent 7c6ac16 commit 5154069
Showing 1 changed file with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,26 +643,12 @@ public function get_item_schema() {
),
);

/*
$schema['properties']['format'] = array(
'description' => __( 'The format for the post.' ),
'type' => 'array',
'type' => 'string',
'context' => array( 'view', 'edit' ),
'anyOf' => array(
array(
'type' => 'string',
'enum' => array_values( get_post_format_slugs() ),
),
array(
'type' => 'array',
'items' => array(
'type' => 'string',
'enum' => array_values( get_post_format_slugs() ),
),
),
),
'enum' => array_values( get_post_format_slugs() ),
);
*/

$taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) );

Expand Down

0 comments on commit 5154069

Please sign in to comment.