[wp-trac] [WordPress Trac] #62120: Removing Global Styles

WordPress Trac noreply at wordpress.org
Thu Sep 26 09:38:54 UTC 2024


#62120: Removing Global Styles
--------------------------+-----------------------------
 Reporter:  mgcwebsites   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  6.6.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62120>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list