diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php index 761c0d6777..bd6b76ac2c 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php @@ -102,10 +102,10 @@ class WP_REST_Block_Pattern_Categories_Controller extends WP_REST_Controller { */ public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); - $keys = array( 'name', 'label' ); + $keys = array( 'name', 'label', 'description' ); $data = array(); foreach ( $keys as $key ) { - if ( rest_is_field_included( $key, $fields ) ) { + if ( isset( $item[ $key ] ) && rest_is_field_included( $key, $fields ) ) { $data[ $key ] = $item[ $key ]; } } @@ -130,18 +130,24 @@ class WP_REST_Block_Pattern_Categories_Controller extends WP_REST_Controller { 'title' => 'block-pattern-category', 'type' => 'object', 'properties' => array( - 'name' => array( + 'name' => array( 'description' => __( 'The category name.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), - 'label' => array( + 'label' => array( 'description' => __( 'The category label, in human readable format.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), + 'description' => array( + 'description' => __( 'The category description, in human readable format.' ), + 'type' => 'string', + 'readonly' => true, + 'context' => array( 'view', 'edit', 'embed' ), + ), ), ); diff --git a/wp-includes/version.php b/wp-includes/version.php index ab30af22b4..e3ef98db48 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55096'; +$wp_version = '6.2-alpha-55097'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.