mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Editor: rename reusable blocks to patterns.
Renames the Reusable blocks to Patterns and adds an option to convert a block or collection of blocks to a non-synced Pattern. Props glendaviesnz, ramonopoly, peterwilsoncc, timothyblynjacobs, flixos90. Fixes #58577. Built from https://develop.svn.wordpress.org/trunk@56030 git-svn-id: http://core.svn.wordpress.org/trunk@55542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8a03512912
commit
69f9f902aa
@ -11,6 +11,7 @@
|
||||
* Returns the list of default categories for block types.
|
||||
*
|
||||
* @since 5.8.0
|
||||
* @since 6.3.0 Reusable Blocks renamed to Patterns.
|
||||
*
|
||||
* @return array[] Array of categories for block types.
|
||||
*/
|
||||
@ -48,7 +49,7 @@ function get_default_block_categories() {
|
||||
),
|
||||
array(
|
||||
'slug' => 'reusable',
|
||||
'title' => _x( 'Reusable Blocks', 'block category' ),
|
||||
'title' => _x( 'Patterns', 'block category' ),
|
||||
'icon' => null,
|
||||
),
|
||||
);
|
||||
|
@ -720,4 +720,7 @@ add_filter( 'render_block', 'wp_render_typography_support', 10, 2 );
|
||||
// User preferences.
|
||||
add_action( 'init', 'wp_register_persisted_preferences_meta' );
|
||||
|
||||
// CPT wp_block custom postmeta field.
|
||||
add_action( 'init', 'wp_create_initial_post_meta' );
|
||||
|
||||
unset( $filter, $action );
|
||||
|
@ -282,26 +282,26 @@ function create_initial_post_types() {
|
||||
'wp_block',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => _x( 'Reusable blocks', 'post type general name' ),
|
||||
'singular_name' => _x( 'Reusable block', 'post type singular name' ),
|
||||
'add_new' => _x( 'Add New', 'Reusable block' ),
|
||||
'add_new_item' => __( 'Add new Reusable block' ),
|
||||
'new_item' => __( 'New Reusable block' ),
|
||||
'edit_item' => __( 'Edit Reusable block' ),
|
||||
'view_item' => __( 'View Reusable block' ),
|
||||
'view_items' => __( 'View Reusable blocks' ),
|
||||
'all_items' => __( 'All Reusable blocks' ),
|
||||
'search_items' => __( 'Search Reusable blocks' ),
|
||||
'not_found' => __( 'No reusable blocks found.' ),
|
||||
'not_found_in_trash' => __( 'No reusable blocks found in Trash.' ),
|
||||
'filter_items_list' => __( 'Filter reusable blocks list' ),
|
||||
'items_list_navigation' => __( 'Reusable blocks list navigation' ),
|
||||
'items_list' => __( 'Reusable blocks list' ),
|
||||
'item_published' => __( 'Reusable block published.' ),
|
||||
'item_published_privately' => __( 'Reusable block published privately.' ),
|
||||
'item_reverted_to_draft' => __( 'Reusable block reverted to draft.' ),
|
||||
'item_scheduled' => __( 'Reusable block scheduled.' ),
|
||||
'item_updated' => __( 'Reusable block updated.' ),
|
||||
'name' => _x( 'Patterns', 'post type general name' ),
|
||||
'singular_name' => _x( 'Pattern', 'post type singular name' ),
|
||||
'add_new' => _x( 'Add New', 'Pattern' ),
|
||||
'add_new_item' => __( 'Add new Pattern' ),
|
||||
'new_item' => __( 'New Pattern' ),
|
||||
'edit_item' => __( 'Edit Pattern' ),
|
||||
'view_item' => __( 'View Pattern' ),
|
||||
'view_items' => __( 'View Patterns' ),
|
||||
'all_items' => __( 'All Patterns' ),
|
||||
'search_items' => __( 'Search Patterns' ),
|
||||
'not_found' => __( 'No patterns found.' ),
|
||||
'not_found_in_trash' => __( 'No patterns found in Trash.' ),
|
||||
'filter_items_list' => __( 'Filter patterns list' ),
|
||||
'items_list_navigation' => __( 'Patterns list navigation' ),
|
||||
'items_list' => __( 'Patterns list' ),
|
||||
'item_published' => __( 'Pattern published.' ),
|
||||
'item_published_privately' => __( 'Pattern published privately.' ),
|
||||
'item_reverted_to_draft' => __( 'Pattern reverted to draft.' ),
|
||||
'item_scheduled' => __( 'Pattern scheduled.' ),
|
||||
'item_updated' => __( 'Pattern updated.' ),
|
||||
),
|
||||
'public' => false,
|
||||
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
|
||||
@ -328,6 +328,7 @@ function create_initial_post_types() {
|
||||
'title',
|
||||
'editor',
|
||||
'revisions',
|
||||
'custom-fields',
|
||||
),
|
||||
)
|
||||
);
|
||||
@ -8018,3 +8019,28 @@ function use_block_editor_for_post_type( $post_type ) {
|
||||
*/
|
||||
return apply_filters( 'use_block_editor_for_post_type', true, $post_type );
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers any additional post meta fields.
|
||||
*
|
||||
* @since 6.3.0 Adds sync_status meta field to the wp_block post type so an unsynced option can be added.
|
||||
*
|
||||
* @link https://github.com/WordPress/gutenberg/pull/51144
|
||||
*/
|
||||
function wp_create_initial_post_meta() {
|
||||
register_post_meta(
|
||||
'wp_block',
|
||||
'sync_status',
|
||||
array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
'single' => true,
|
||||
'type' => 'string',
|
||||
'show_in_rest' => array(
|
||||
'schema' => array(
|
||||
'type' => 'string',
|
||||
'enum' => array( 'partial', 'unsynced' ),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.3-alpha-56029';
|
||||
$wp_version = '6.3-alpha-56030';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user