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

Fix compatibility with WP 6.0.x #46806

Merged
merged 1 commit into from
Dec 28, 2022
Merged

Fix compatibility with WP 6.0.x #46806

merged 1 commit into from
Dec 28, 2022

Conversation

Mamaduka
Copy link
Member

What?

Fixes #46802.

PR fixes compatibility with WP 6.0.x.

Why?

The WP_Theme_JSON was using the wp_get_typography_font_size_value method only available in WP 6.1.

How?

Replaced the wp_get_typography_font_size_value with gutenberg_get_typography_font_size_value

The same method when used in blocks is automatically renamed during the build. So no need to rename them manually.

Testing Instructions

  1. Test using WP 6.0 - wp core update --version=6.0.3 --force
  2. Confirm there are no PHP fatal errors when accessing the site.
  3. Add a Search block to the post and change font size.
  4. Confirm block doesn't trigger PHP fatal errors

An example error

PHP Fatal error:  Uncaught Error: Call to undefined function wp_get_typography_font_size_value() in ~/wp-content/plugins/gutenberg/lib/class-wp-theme-json-gutenberg.php:1809

@Mamaduka Mamaduka self-assigned this Dec 28, 2022
@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts labels Dec 28, 2022
@Mamaduka Mamaduka requested review from ockham and oandregal and removed request for spacedmonkey December 28, 2022 06:56
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM👍

  • Tested on WP6.0.3
  • No critical errors in admin screen, post/site editor, or front end
  • No errors in frontend after adding blocks (core/search, core/navigation-link, core/navigation-submenu) that use wp_get_typography_font_size_value in dynamic rendering

@Mamaduka Mamaduka merged commit 78c25cf into trunk Dec 28, 2022
@Mamaduka Mamaduka deleted the fix/wp-6.0-compat branch December 28, 2022 08:27
@github-actions github-actions bot added this to the Gutenberg 14.9 milestone Dec 28, 2022
noahtallen pushed a commit that referenced this pull request Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

blank pages on WP 6.0.3 with plugin 14.8.1
3 participants