[wp-trac] [WordPress Trac] #12009: Add support for HTML 5 "async" and "defer" attributes
WordPress Trac
wp-trac at lists.automattic.com
Sat Jan 14 18:42:53 UTC 2012
#12009: Add support for HTML 5 "async" and "defer" attributes
-------------------------------------+-----------------------------
Reporter: Otto42 | Owner: azaozz
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: JavaScript | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-testing |
-------------------------------------+-----------------------------
Comment (by toscho):
These attributes are backwards compatible. I don’t think supporting them
would do any harm.
But I don’t like more arguments for `wp_register_script()`. We have
already four, that’s more than enough. How about a very simple extra
string in `WP_Scripts::do_item()`?
{{{
$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
$extra = apply_filters( 'script_extra', '', $src, $handle );
if ( $this->do_concat )
$this->print_html .= "<script type='text/javascript' src='$src'
$extra></script>\n";
else
echo "<script type='text/javascript' src='$src'
$extra></script>\n";
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12009#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list