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

Element styles: prevent the WordPress filter callback from being executed #40594

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Apr 25, 2022

What?

Follow up to #37728

Stops a filter callback added by WordPress, as Gutenberg will take care of doing the same.

Why?

We don't want to end up enqueuing styles or attaching classes to blocks twice.

In #37728 we introduced a new filter callback for elements styles, which is being backported to core in WordPress/wordpress-develop#2624 This follow-up makes sure that the core callback is not executed in the Gutenberg plugin.

How?

Removes the filter callback added by WordPress.

Testing Instructions

  • Create a group block and set the link color to red.
  • Create a paragraph block and set the link color to purple.

The expected result is that both editor and front end show the paragraph link color as purple.

@oandregal oandregal self-assigned this Apr 25, 2022
@oandregal oandregal added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Apr 25, 2022
@ramonjd
Copy link
Member

ramonjd commented Apr 26, 2022

LGTM

Editor

Screen Shot 2022-04-26 at 10 19 04 am

Frontend

Screen Shot 2022-04-26 at 10 18 27 am

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

👍

@oandregal oandregal merged commit d36ee96 into trunk Apr 26, 2022
@oandregal oandregal deleted the update/element-styles-after-backport branch April 26, 2022 08:16
@github-actions github-actions bot added this to the Gutenberg 13.2 milestone Apr 26, 2022
@georgeh georgeh added the [Type] Bug An existing feature does not function as intended label May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [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