Skip to content

Block Editor: Rename reusable blocks private APIs to user patterns - #85175

Open
dhruvikpatel18 wants to merge 1 commit into
WordPress:trunkfrom
dhruvikpatel18:refactor/rename-reusable-blocks-private-apis
Open

dhruvikpatel18 wants to merge 1 commit into
WordPress:trunkfrom
dhruvikpatel18:refactor/rename-reusable-blocks-private-apis

Conversation

@dhruvikpatel18

@dhruvikpatel18 dhruvikpatel18 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

What?

See #57530

Renames the "reusable blocks" private APIs in @wordpress/block-editor (and the matching code in @wordpress/editor) to "user patterns". Public APIs are unchanged.

Why?

Reusable blocks were renamed to patterns in the UI earlier, but much of the code still uses the old name, which makes it harder to follow. #57530 tracks this debt and notes that private APIs can be renamed freely. This PR does that for the private APIs that feed user patterns into the block editor, as a first, low-risk step.

The new name is "user patterns" rather than "synced patterns" because these APIs return every wp_block post, unsynced patterns included. It also matches names the code already uses: the UserPattern type, mapUserPattern(), INSERTER_PATTERN_TYPES.user and userPatternCategoriesSelectKey.

Testing Instructions

  1. Create two patterns from the block toolbar's Options menu: one with Synced on and one with it off.
  2. Open a new post and open the inserter's Patterns tab. Choose My patterns and check that both patterns are listed.
  3. Insert the synced pattern and check that it renders and can be edited.
  4. Search the block inserter for the synced pattern by name and insert it from there.
  5. Repeat steps 2–4 in the Site Editor, and in the extensible site editor with the gutenberg-extensible-site-editor experiment enabled.

One thing to note: @wordpress/editor reads the settings key from @wordpress/block-editor's private APIs. If someone installs mismatched npm versions of the two packages, user patterns would not show in the inserter. The plugin and Core always ship the two packages together, and private APIs are not meant to work across mismatched versions.

Screenshots or screencast

N/A, no visual changes.

@dhruvikpatel18 dhruvikpatel18 self-assigned this Oct 20, 2026
@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] Block editor /packages/block-editor labels Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dhruvikpatel18 <dhruvik18@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

@dhruvikpatel18 dhruvikpatel18 added [Type] Code Quality Issues or PRs that relate to code quality [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Oct 20, 2026
@dhruvikpatel18
dhruvikpatel18 marked this pull request as ready for review October 20, 2026 09:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Package] Block editor /packages/block-editor [Package] Editor /packages/editor [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant