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 WP 5.9 check for conditionally running code #37235

Merged
merged 1 commit into from
Dec 9, 2021
Merged

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Dec 8, 2021

Description

Use a different function to check if the plugin runs on an older WP version. The wp_is_block_theme got ported back to the plugin (#37218). PR update conditional check to use a function that's WP core specific and was introduced in 5.9 - wp_list_users

The current logic only works because the compat/wordpress-5.9/theme.php file is included later in load.php.

How has this been tested?

  1. Make sure you're running WordPress 5.9
  2. Change something related to one of the post types in the Gutenberg codebase (i.e., one of the labels)
  3. Load the relevant part of the UI and notice the change is not displayed because this code isn't active.

Borrowed Copied from #36898.

Types of changes

Bugfix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@Mamaduka Mamaduka requested a review from talldan December 8, 2021 18:25
@Mamaduka Mamaduka self-assigned this Dec 8, 2021
@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended Core REST API Task Task for Core REST API efforts [Feature] Templates API Related to API powering block template functionality in the Site Editor labels Dec 8, 2021
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Thanks. Looks like this code went on a journey, wp_is_block_theme isn't even what I originally added here 😄

@talldan talldan added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Dec 9, 2021
@talldan
Copy link
Contributor

talldan commented Dec 9, 2021

I don't think it needs backporting, but might be good to keep the wp/trunk branch in sync like the other PRs.

@talldan talldan merged commit 605f288 into trunk Dec 9, 2021
@talldan talldan deleted the fix/wp-5.9-check branch December 9, 2021 03:41
@github-actions github-actions bot added this to the Gutenberg 12.2 milestone Dec 9, 2021
@noisysocks noisysocks removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Dec 13, 2021
noisysocks pushed a commit that referenced this pull request Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts [Feature] Templates API Related to API powering block template functionality in the Site Editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants