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 mistake in _remove_theme_attribute_in_block_template_content #37137

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Dec 6, 2021

Description

In #36898 I tried updating the _remove_theme_attribute_in_block_template_content to match core, but made a mistake in that I only copy/pasted the if statement over from core (https://github.com/WordPress/gutenberg/pull/36898/files#r762692470).

The part that I missed is that in WordPress core, the condition of the if statement was inverted. I should've updated the whole function.

In this PR I'm fixing that.

Thanks to @noisysocks for spotting the issue.

How has this been tested?

I don't really know how to test this, but the function as defined in this PR should now match WordPress core:
https://github.com/WordPress/wordpress-develop/blob/7f1166c8918b4862fd1b8dd72ba6bf5b723b369e/src/wp-includes/block-template-utils.php#L466-L488

Types of changes

Bug fix (non-breaking change which fixes an issue)

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).

@talldan talldan added [Type] Bug An existing feature does not function as intended [Feature] Templates API Related to API powering block template functionality in the Site Editor labels Dec 6, 2021
@talldan talldan self-assigned this Dec 6, 2021
Copy link
Member

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

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

@noisysocks noisysocks 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 6, 2021
@talldan talldan merged commit 721d7b1 into trunk Dec 6, 2021
@talldan talldan deleted the fix/messed-up-function branch December 6, 2021 05:52
@github-actions github-actions bot added this to the Gutenberg 12.2 milestone Dec 6, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[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