diff --git a/wp-includes/block-patterns.php b/wp-includes/block-patterns.php index 91d239db52..074ed33c84 100644 --- a/wp-includes/block-patterns.php +++ b/wp-includes/block-patterns.php @@ -189,6 +189,7 @@ function _register_remote_theme_patterns() { * - Categories (comma-separated values) * - Keywords (comma-separated values) * - Block Types (comma-separated values) + * - Post Types (comma-separated values) * - Inserter (yes/no) * * @since 6.0.0 @@ -203,6 +204,7 @@ function _register_theme_block_patterns() { 'categories' => 'Categories', 'keywords' => 'Keywords', 'blockTypes' => 'Block Types', + 'postTypes' => 'Post Types', 'inserter' => 'Inserter', ); @@ -274,7 +276,7 @@ function _register_theme_block_patterns() { } // For properties of type array, parse data as comma-separated. - foreach ( array( 'categories', 'keywords', 'blockTypes' ) as $property ) { + foreach ( array( 'categories', 'keywords', 'blockTypes', 'postTypes' ) as $property ) { if ( ! empty( $pattern_data[ $property ] ) ) { $pattern_data[ $property ] = array_filter( preg_split( diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php index 15a7c28279..60064abf05 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php @@ -124,6 +124,7 @@ public function prepare_item_for_response( $item, $request ) { 'description' => 'description', 'viewportWidth' => 'viewport_width', 'blockTypes' => 'block_types', + 'postTypes' => 'post_types', 'categories' => 'categories', 'keywords' => 'keywords', 'content' => 'content', @@ -185,6 +186,12 @@ public function get_item_schema() { 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), + 'post_types' => array( + 'description' => __( ' An array of post types that the pattern is restricted to be used with.' ), + 'type' => 'array', + 'readonly' => true, + 'context' => array( 'view', 'edit', 'embed' ), + ), 'categories' => array( 'description' => __( 'The pattern category slugs.' ), 'type' => 'array', diff --git a/wp-includes/version.php b/wp-includes/version.php index 9a913b63f4..e739d444d6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-54262'; +$wp_version = '6.1-alpha-54263'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.