• Resolved Fist Full of Crisco

    (@fistfullofcrisco)


    Line 4034 of youtube.php has this line:

    wp_localize_script('__ytprefs__', '_EPYT_', $my_script_vars);

    The first parameter is the __ytprefs__ script handle which will place its inline script code right above the ytprefs.min.js external script call. Because __ytprefs__ depends on jquery i was wondering if you guys could modify that line above to point to jquery instead of __ytprefs__. For example the new line would be:

    wp_localize_script('jquery', '_EPYT_', $my_script_vars);

    By doing it this way you would allow popular cache plugins like W3 Total Cache, and W3 Super Cache to be able to properly minify YT Embed Plus into a single js file instead of needing it to be broken up into several js files because the inline script code that you place confuses these cache plugins..but if its placed above the jquery call it makes minifying easier.

    I tried it out and it works much better…YT Embed Plus obviously still works perfectly, but now when using minifying features of caching programs i now get a single js file (merges jquery, YTE+, and my other plugins) instead of 3 just for YTE+.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author embedplus

    (@embedplus)

    Hi,

    Your logic seems correct. We’ll explore this idea in the next update of the plugin.

    -EmbedPlus Team

    Plugin Author embedplus

    (@embedplus)

    Unfortunately we’ve had to roll this back due to jQuery Updater not being compatible with wp_localize_script in that way.

    -EmbedPlus Team

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Curious — Why doesnt the wp_localize_script() use the jquery handle instead?’ is closed to new replies.