rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -710,6 +710,10 @@ class WP_REST_Menu_Items_Controller extends WP_REST_Posts_Controller {
* @return array Item schema data.
*/
public function get_item_schema() {
if ( $this->schema ) {
return $this->add_additional_fields_schema( $this->schema );
}
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => $this->post_type,
@@ -792,7 +796,7 @@ class WP_REST_Menu_Items_Controller extends WP_REST_Posts_Controller {
),
'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array(
'sanitize_callback' => function ( $value ) {
'sanitize_callback' => static function ( $value ) {
return array_map( 'sanitize_html_class', wp_parse_list( $value ) );
},
),
@@ -873,7 +877,7 @@ class WP_REST_Menu_Items_Controller extends WP_REST_Posts_Controller {
),
'context' => array( 'view', 'edit', 'embed' ),
'arg_options' => array(
'sanitize_callback' => function ( $value ) {
'sanitize_callback' => static function ( $value ) {
return array_map( 'sanitize_html_class', wp_parse_list( $value ) );
},
),
@@ -914,7 +918,9 @@ class WP_REST_Menu_Items_Controller extends WP_REST_Posts_Controller {
$schema['links'] = $schema_links;
}
return $this->add_additional_fields_schema( $schema );
$this->schema = $schema;
return $this->add_additional_fields_schema( $this->schema );
}
/**