[wp-trac] [WordPress Trac] #54956: [5.9] wp_block_type args - "style" and "script" are always loaded on Frontend

WordPress Trac noreply at wordpress.org
Fri Jul 8 12:08:35 UTC 2022


#54956: [5.9] wp_block_type args - "style" and "script" are always loaded on
Frontend
-------------------------------+------------------------------
 Reporter:  pkostadinov        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Editor             |     Version:  5.9
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by pkostadinov):

 Also seems to be related to this:

 https://developer.wordpress.org/reference/hooks/should_load_separate_core_block_assets/

 The name of the filter makes it sound like it only affect Core blocks, bit
 this seems to affect custom blocks assets as well.

 When I did a `__return_true`, this fixed my issue.

 I don't understand why this filter exists in the first place, and why the
 default is false - the default should always be to not load CSS that you
 are not using on the page, aka true.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54956#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list