[wp-trac] [WordPress Trac] #43248: wp_localize_script() and ultimately print_extra_script() not using script_loader_tag filter

WordPress Trac noreply at wordpress.org
Tue Jul 9 13:38:43 UTC 2019


#43248: wp_localize_script() and ultimately print_extra_script() not using
script_loader_tag filter
---------------------------+------------------------------
 Reporter:  csmillie       |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  4.9.4
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  javascript
---------------------------+------------------------------

Comment (by ShortPixel):

 I have a use case for this. We're using the filter to add this attribute:
 {{{
 data-cfasync="false"
 }}}
 to our JS so that it's not asynced out by Cloudflare. The problem is that
 the script is localized and it depends on the localized variables but the
 localized part is not caught by the filter so the main script needs to
 wait anyway for the async part... The solution for us would be any method
 to add the data-cfasync attribute also to the localized script section.

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


More information about the wp-trac mailing list