Skip to content
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

Update pattern overrides to use a hard coded support array #57912

Merged

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Jan 17, 2024

What?

Part of #53705.

In #57742, the public global $block_bindings_allowed_blocks variable will be removed in favour of private code.

This PR removes the pattern overrides dependency on that array, so that things don't break when #57742 is merged.

How?

Duplicates the array. While this isn't great for maintenance, it should be fine while the list of supported blocks/attributes is small and unlikely to change much.

Testing Instructions

Follow the instructions in #53705 (comment), and ensure overrides still work for headings, paragraphs and buttons

…n the soon to be removed block bindings global
@talldan talldan added [Type] Task Issues or PRs that have been broken down into an individual action to take [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Jan 17, 2024
@talldan talldan self-assigned this Jan 17, 2024
@talldan talldan requested a review from spacedmonkey as a code owner January 17, 2024 09:10
Copy link

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/block-supports/pattern.php

Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

✅ Allowed blocks matches process_block_bindings function
✅ Tests as per instructions in #53705 (comment)
✅ Fixes fatal PHP error on trunk currently

Fatal error: Uncaught TypeError: array_key_exists): Argument #2 ($array) must be of type array

@talldan talldan merged commit d159752 into trunk Jan 18, 2024
61 checks passed
@talldan talldan deleted the update/pattern-overrides-to-use-hardcoded-support-config branch January 18, 2024 01:15
@github-actions github-actions bot added this to the Gutenberg 17.6 milestone Jan 18, 2024
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 [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants