-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Template Activation: Rename gutenberg_get_block_template #73582
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I'm surprised we added |
|
I just cherry-picked this PR to the release/22.2 branch to get it included in the next release: 5c38ef1 |
* Allow 2 args in gutenberg_get_block_template * Fix copy paste error * Simplify fix * Update function name Co-authored-by: mikachan <[email protected]> Co-authored-by: ellatrix <[email protected]> Co-authored-by: scruffian <[email protected]>
* Allow 2 args in gutenberg_get_block_template * Fix copy paste error * Simplify fix * Update function name Co-authored-by: mikachan <[email protected]> Co-authored-by: ellatrix <[email protected]> Co-authored-by: scruffian <[email protected]>
|
I just cherry-picked this PR to the release/22.1 branch to get it included in the next release: abbe408 |
What?
This fixes the following error, which can be triggered by plugins calling the old
gutenberg_get_block_templatefunction with two arguments when the Template Activation experiment is enabled:Fatal error: Uncaught ArgumentCountError: Too few arguments to function gutenberg_get_block_template(), 2 passed in /wp-content/plugins/directorist/blocks/includes/class-block-templates-controller.php on line 93 and exactly 3 expected in /wordpress/plugins/gutenberg/22.1.2/lib/compat/wordpress-6.9/template-activate.php:591This example is from the Directorist plugin, but this would happen for any plugin using this function with two args.
Why?
Prevents fatal errors from
gutenberg_get_block_template().How?
Allows all three args to be
null, and if there are only two passed, treat them asget_block_template()would treat two args.Testing Instructions
gutenberg_get_block_templatefunction with 2 args, e.g. Directorist