Support » Plugin: qTranslate » [Plugin: qTranslate] Strange wp_enqueue_style and plugins_url issue

  • Hi,

    I noticed a weird thing happening since upgrading to 3.1 with queueing a stylesheet in my own pluging Easy FancyBox with qTranslate in pre-path mode.

    First consider these pieces of the code, the first one queuing a javascript and the second one queueing the stylesheet:

    wp_enqueue_script('jquery.fancybox', plugins_url('/jquery.fancybox.js', __FILE__), array('jquery'), '0.1');
    wp_enqueue_style('easy-fancybox.css', plugins_url('/easy-fancybox.css', __FILE__), array(), '0.1', 'screen');

    Both combine function wp_enqueue_style with plugins_url and they are both called via an add_action call.

    However, the results are different! In the first case (wp_enqueue_script) qTranslate leaves the URL as it is supposed to be but in the second case (wp_enqueue_style) qTranslate injects the language in there, breaking the stylesheet URL!

    Replacing the plugins_url(...) with WP_PLUGIN_URL... in wp_enqueue_style will fix the issue but I wonder why there is a difference at all? And is this a WP3.1 thing? I have not noticed it before on WP 2.9/3.0 …

  • The topic ‘[Plugin: qTranslate] Strange wp_enqueue_style and plugins_url issue’ is closed to new replies.