Rename WP_Theme::is_block_based to WP_Theme::is_block_theme and wp_is_block_template_theme to wp_is_block_theme#2014
Conversation
This reverts commit 591267f.
costdev
left a comment
There was a problem hiding this comment.
Renaming looks good 👍 Just one note that the test can be simplified.
| function wp_is_block_template_theme() { | ||
| return is_readable( get_theme_file_path( '/block-templates/index.html' ) ) || | ||
| is_readable( get_theme_file_path( '/templates/index.html' ) ); | ||
| function wp_is_block_theme() { |
There was a problem hiding this comment.
@anton-vlasenko As Gutenberg has to support WP 5.7 and 5.8, how will renaming this function impact the plugin? Are you planning to rename it in Gutenberg too and deprecate the original name? Or does renaming not affect Gutenberg?
There was a problem hiding this comment.
@hellofromtonya Companion issue is here and the PR for that issue seems to have been updated in line with this page.
There was a problem hiding this comment.
@hellofromtonya
Yes, I'm planning to rename it in Gutenberg. I've created a PR that renames it.
IMO it doesn't make sense to keep both wp_is_block_theme and wp_is_block_template_theme functions in WordPress Core.
I think we still have time to rename it in Gutenberg before the Gutenberg 12.1.0 release.
There was a problem hiding this comment.
Thanks @anton-vlasenko. Part of the consolidation discuss is to help with the backports from Gutenberg to Core. So wanted to make sure whatever happens here also happens in the Gutenberg repo too, i.e. code matches.
There was a problem hiding this comment.
Thank you for making sure, @hellofromtonya.
I 100% agree.
We need to be careful to make sure we don't break Gutenberg.
|
Committed via https://core.trac.wordpress.org/changeset/52330. |
Trac ticket: https://core.trac.wordpress.org/ticket/54552
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.