'viewportWidth' => 'viewport_width',
'inserter' => 'inserter',
'categories' => 'categories',
'keywords' => 'keywords',
'blockTypes' => 'block_types',
'postTypes' => 'post_types',
'templateTypes' => 'template_types',
'source' => 'source',
);
$data = array
();
foreach ( $keys as $item_key =>
$rest_key ) { if ( isset( $item[ $item_key ] ) &&
rest_is_field_included( $rest_key,
$fields ) ) { $data[ $rest_key ] =
$item[ $item_key ];
} } $context = !
empty( $request['context'
] ) ?
$request['context'
] : 'view';
$data =
$this->
add_additional_fields_to_object( $data,
$request );
$data =
$this->
filter_response_by_context( $data,
$context );
return rest_ensure_response( $data );
} /**
* Retrieves the block pattern schema, conforming to JSON Schema.
*
* @since 6.0.0
* @since 6.3.0 Added `source` property.
*
* @return array Item schema data.
*/