-
Notifications
You must be signed in to change notification settings - Fork 3.5k
backport Rename Reusable blocks to Patterns #4646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
daeb820
4c0252a
30d7fad
531eacb
1c4ebfc
2dcc313
4fdf7fb
615e369
f50707b
82226cc
4a1dcf3
acc702f
49fea36
e5919fb
5d9e2de
e2b0ec5
53337c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -282,26 +282,26 @@ function create_initial_post_types() { | |
| 'wp_block', | ||
| array( | ||
| 'labels' => array( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to say this one could have a |
||
| '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', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is custom fields support actually needed?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my testing the postmeta sync_status field was not returned without this.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are however going to look at returning it via REST as a top-level |
||
| ), | ||
| ) | ||
| ); | ||
|
|
@@ -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' ), | ||
| ), | ||
| ), | ||
| ) | ||
| ); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.