[wp-meta] [Making WordPress.org] #5858: Inline custom CSS on /news/ pages

Making WordPress.org noreply at wordpress.org
Thu Aug 12 01:38:01 UTC 2021


#5858: Inline custom CSS on /news/ pages
--------------------------------+---------------------
 Reporter:  jonoaldersonwp      |       Owner:  (none)
     Type:  enhancement         |      Status:  closed
 Priority:  lowest              |   Milestone:
Component:  WordPress.org Site  |  Resolution:  fixed
 Keywords:  performance seo     |
--------------------------------+---------------------
Changes (by dd32):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 Jetpack supports inlining the CSS, but only does it for CSS that is less
 than 2k characters, `/news/` custom css is 3.3k.

 In r17657-dotorg: `Jetpack Tweaks: Always inline the Custom CSS.`
 {{{
 !#diff
 Index: jetpack-tweaks.php
 ===================================================================
 --- jetpack-tweaks.php  (revision 17654)
 +++ jetpack-tweaks.php  (working copy)
 @@ -43,0 +44,9 @@
 +
 +// Custom CSS should always be inlined. See
 https://meta.trac.wordpress.org/ticket/5858
 +add_action( 'init', function() {
 +       add_filter( 'safecss_embed_style', '__return_true', 11 );
 +
 +       // The 4.7+-compat custom-css class doesn't use that filter...
 +       remove_action( 'wp_head', array(
 'Jetpack_Custom_CSS_Enhancements', 'wp_custom_css_cb' ), 101 );
 +       add_action( 'wp_head', 'wp_custom_css_cb', 101 );
 +}, 11 );
 }}}

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/5858#comment:7>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list