Make WordPress Core

Opened 12 days ago

#62120 new defect (bug)

Removing Global Styles

Reported by: mgcwebsites's profile 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.

Attachments (1)

wp_bug.zip (1.3 KB) - added by mgcwebsites 12 days ago.
A theme that will let you test the issue in isolation

Download all attachments as: .zip

Change History (1)

@mgcwebsites
12 days ago

A theme that will let you test the issue in isolation

Note: See TracTickets for help on using tickets.