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: Missing CSS when do_blocks is ran early #683

Merged
merged 2 commits into from
Sep 5, 2022

Conversation

tomusborne
Copy link
Owner

alternative to #682

#682 works but has an issue where CSS (singular and block-specific) is duplicated when using block themes.

This method works by using wp_enqueue_scripts and wp_add_inline_style for our inline style. This works because wp_enqueue_scripts fires before wp_head which is where Slim SEO (in this case) is calling do_blocks.

We also have to check $block_ids within the generateblocks_get_dynamic_css function to prevent duplicate CSS in block themes.

Not sure if this is the best solution.

@tomusborne tomusborne added the bug Bugs, unexpected and weird behaviors label Sep 3, 2022
@tomusborne tomusborne added this to the 1.6.0 milestone Sep 3, 2022
@tomusborne tomusborne requested a review from JeanPaiva September 3, 2022 03:25
Copy link
Contributor

@JeanPaiva JeanPaiva left a comment

Choose a reason for hiding this comment

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

I could not find any CSS duplication with GP/2022 block theme or widget areas, and the original issue is still fixed.

includes/functions.php Outdated Show resolved Hide resolved
@tomusborne tomusborne merged commit 8abf7b2 into release/1.6.0 Sep 5, 2022
@tomusborne tomusborne deleted the fix-missing-css branch September 5, 2022 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs, unexpected and weird behaviors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants