Opened 12 days ago
#62120 new defect (bug)
Removing Global Styles
Reported by: | mgcwebsites | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.6.2 |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
I am creating a bespoke theme and using wp_dequeue_style( 'global-styles' ) in the wp_enqueue_scripts to remove the #global-styles-inline-css style tag from the document head. Whilst this works normally, I have found the following steps break it:
On a page, add a buttons block, add a button, setting its style to outline.
Now save the page and examine the HTML source.
You will find that the #global-styles-inline-css style tag is now output - not in the head but in the wp_footer() location (note theme must implement this to reproduce the bug).
Adding and removing wp_dequeue_style( 'global-styles' ) now simply moves the <script> tag between the header and footer.
Expected behaviour would be for the <script> tag to have been completely removed regardless of page content.
A theme that will let you test the issue in isolation