#58577 closed enhancement (fixed)
Backport: rename of reusable blocks to patterns
Reported by: | glendaviesnz | Owned by: | isabel_brison |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | has-patch has-unit-tests gutenberg-merge |
Focuses: | Cc: |
Description
Renames the Reusable blocks to Patterns. Also adds the option to convert a block or collection of blocks to a non-synced Pattern. This then behaves as imported Patterns do in that once inserted they can be edited completely independently of any other instances of the Pattern. The synced version of the Pattern works as the existing Reusable blocks do in that editing one instance updates all instances.
Change History (13)
This ticket was mentioned in PR #4646 on WordPress/wordpress-develop by @glendaviesnz.
15 months ago
#1
- Keywords has-patch has-unit-tests added
#2
@
15 months ago
- Component changed from General to Editor
- Keywords gutenberg-merge added
- Milestone changed from Awaiting Review to 6.3
Related to https://core.trac.wordpress.org/ticket/58579
@glendaviesnz commented on PR #4646:
15 months ago
#3
Any thoughts on how to best test this? I did look at adding a unit test to tests/phpunit/tests/rest-api/rest-blocks-controller.php
but the wp_register_wp_block_postmeta
filter is not run for the rest unit tests so the postmeta is not returned there.
@TimothyBlynJacobs commented on PR #4646:
15 months ago
#4
I would say exposing this value through meta
is a bit odd for Core. Since this is a first party field, we can expose it as top-level property like sync_status
. That'd happen through either modifying the WP_REST_Blocks_Controller
or using register_rest_field
.
@glendaviesnz commented on PR #4646:
15 months ago
#5
I would say exposing this value through
meta
is a bit odd for Core. Since this is a first party field, we can expose it as top-level property likesync_status
. That'd happen through either modifying theWP_REST_Blocks_Controller
or usingregister_rest_field
.
That makes sense @TimothyBJacobs, but would require changes to Gutenberg which I think is about to have the RC version cut. Can we keep it as is for the first beta and update it after that is out? It is a minor implementation detail and doesn't affect the underlying data structure so doesn't seem like it will have any impact to do this as a follow up. What do you think?
@TimothyBlynJacobs commented on PR #4646:
15 months ago
#6
Yep that seems fine to me.
@glendaviesnz commented on PR #4646:
15 months ago
#7
Thanks for the reviews everyone!
#8
@
15 months ago
- Owner set to isabel_brison
- Resolution set to fixed
- Status changed from new to closed
In 56030:
#11
@
13 months ago
Just noting that [56030] introduced a string __( 'Add new Pattern' )
where 'new' is lowercase. This is inconsistent with the well established pattern in WordPress, where all similar strings use title case for the word 'New', for example:
__( 'Add New Template' )
Could be fixed in #47125 if the changes proposed there get approved or, alternatively, I think a quick commit would be fine without the need to reopen this ticket or create a new one. Cc @isabel_brison
Renames the Reusable blocks to Patterns. Also adds the option to convert a block or collection of blocks to a non-synced Pattern. This then behaves as imported Patterns do in that once inserted they can be edited completely independently of any other instances of the Pattern. The synced version of the Pattern works as the existing Reusable blocks do in that editing one instance updates all instances.
From: https://github.com/WordPress/gutenberg/pull/51144
Trac ticket: [](https://core.trac.wordpress.org/ticket/58577)