diff --git a/lib/compat/wordpress-6.2/class-gutenberg-rest-block-pattern-categories-controller.php b/lib/compat/wordpress-6.2/class-gutenberg-rest-block-pattern-categories-controller.php index 151d30dbf9fe24..970b1c4a1a330d 100644 --- a/lib/compat/wordpress-6.2/class-gutenberg-rest-block-pattern-categories-controller.php +++ b/lib/compat/wordpress-6.2/class-gutenberg-rest-block-pattern-categories-controller.php @@ -28,7 +28,7 @@ public function prepare_item_for_response( $item, $request ) { $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 ]; } }