[wp-hackers] possible to add data for scripts like you can with styles?

Amy Hendrix sabreuse at gmail.com
Fri Mar 1 00:15:28 UTC 2013


It's not possible. There's a Trac ticket for it (
http://core.trac.wordpress.org/ticket/16024) but given the latest comments
there, I'd say it doesn't look too likely. A better practice is to use
feature detection with like Modernizr for the specific features you're
trying to use.


On Thu, Feb 28, 2013 at 7:08 PM, chris <chris at lod.com> wrote:

> Is it possible to do this?
>
> add_action('wp_enqueue_scripts', 'fresh_scripts');
>
> function fresh_scripts() {
>         global $wp_scripts;
>
>         wp_register_script( 'css3_media_queries',
> 'http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js
> ')
> ;
>         $wp_scripts->add_data( 'css3_media_queries', 'conditional', 'lt IE
> 9' );
>     wp_enqueue_script('css3_media_queries');
> }
>
> Is what im using but no conditional gets added.
>
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list