[wp-trac] [WordPress Trac] #22245: Add Hook: "script_loader_tag"

WordPress Trac noreply at wordpress.org
Sun Oct 21 20:16:31 UTC 2012


#22245: Add Hook: "script_loader_tag"
--------------------------------------+------------------------------
 Reporter:  ryanve                    |       Owner:
     Type:  feature request           |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Formatting                |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback needs-patch  |
--------------------------------------+------------------------------

Comment (by ryanve):

 {{{
 add_filter( 'script_loader_tag', function ( $html, $handle ) {
     return 'example' === $handle ? str_replace('<script ', '<script async
 ', $html) : $html;
 }, 12, 2);
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22245#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list