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

Section Styles: Prevent frontend filters in admin #62859

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

aaronrobertshaw
Copy link
Contributor

What?

Adds an early return for the block style variation PHP filters when in the admin.

Why?

When in either editor, a JS hook is required given the style variations applied to blocks can be changed, blocks moved around within nested variations etc.

How?

For the two filters used to process the block style variations, return early is_admin() is true.

Testing Instructions

  1. Defines block style variations via the different sources below:
    • register_block_style
    • Theme.json partial file under /styles directory including blockTypes
    • Within a theme style variation under styles.variations (must be registered via either of the above two methods)
  2. Check that the block style variations still apply and are displayed correctly in both editors and the frontend

Screenshots or screencast

There should be no visual changes.

@aaronrobertshaw aaronrobertshaw added [Type] Performance Related to performance efforts Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jun 26, 2024
@aaronrobertshaw aaronrobertshaw self-assigned this Jun 26, 2024
@aaronrobertshaw aaronrobertshaw 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 Jul 9, 2024
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] Performance Related to performance efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant