-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Remove GB prefixed functions from template part #36180
Remove GB prefixed functions from template part #36180
Conversation
) { | ||
$block['attrs']['theme'] = wp_get_theme()->get_stylesheet(); | ||
$has_updated_content = true; | ||
if ( ! function_exists( '_inject_theme_attribute_in_block_template_content' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that works until we do some changes in these functions for future releases. It might never be required so I think it's fine for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general is it okay to rename function without the GB prefix in the plugin? I guess for functionality that is added through filters or actions we don't rename and bail early like here, but in util functions?
We already have the problem of not being able to change some functions like here.
Are there any instructions for how these cases are handled? --cc @gziolo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no rules for updating the functionality that is in WP core. If the utility function doesn’t fit anymore you can always deprecate it and create a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this solves the template part block code issue. I did rename a lot more functions on the core patch and there's a lot of functions that might need to have a function check before redefining here.
Will look into these changes. |
It would be helpful to move the code that is about to be include in WordPress 5.9 to the |
) { | ||
$block['attrs']['theme'] = wp_get_theme()->get_stylesheet(); | ||
$has_updated_content = true; | ||
if ( ! function_exists( '_inject_theme_attribute_in_block_template_content' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no rules for updating the functionality that is in WP core. If the utility function doesn’t fit anymore you can always deprecate it and create a new one.
This will be needed for back porting the FSE changes in core: WordPress/wordpress-develop#1796