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

Button Block: Remove backwards compatibility code for WP6.4 #63115

Closed
t-hamano opened this issue Jul 4, 2024 · 0 comments · Fixed by #64096
Closed

Button Block: Remove backwards compatibility code for WP6.4 #63115

t-hamano opened this issue Jul 4, 2024 · 0 comments · Fixed by #64096
Assignees
Labels
[Block] Buttons Affects the Buttons Block [Type] Code Quality Issues or PRs that relate to code quality

Comments

@t-hamano
Copy link
Contributor

t-hamano commented Jul 4, 2024

In #63082, backwards compatible code for WP6.4 was added to the Button block. This PR will be part of Gutenberg version 18.7.1.

This code should be reverted after the Gutenberg plugin drops support for WP6.4 in the near future.

/*
* The current Gutenberg plugin supports WordPress 6.4, but the next_token()
* method does not exist in WordPress 6.4. Therefore, if Gutenberg is used
* as a plugin, use the Gutenberg class that has the `next_token()` method.
*
* TODO: After the Gutenberg plugin drops support for WordPress 6.4, this
* conditional statement will be removed and the core class `WP_HTML_Tag_Processor`
* should be used.
*/
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && class_exists( 'Gutenberg_HTML_Tag_Processor_6_5' ) ) {
$p = new Gutenberg_HTML_Tag_Processor_6_5( $content );
} else {
$p = new WP_HTML_Tag_Processor( $content );
}

To make sure I don't forget to do this, I'll submit an issue.

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Block] Buttons Affects the Buttons Block labels Jul 4, 2024
@t-hamano t-hamano self-assigned this Jul 4, 2024
@talldan talldan linked a pull request Jul 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant