Enqueue the css stylesheet in a more proper way
-
GTranslate::enqueue_scripts
The Constant PLUGINDIR has been deprecated since 2.1.0 but will be defined by WordPress to be backward compat. therefor change the following code:
$wp_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) ); wp_enqueue_style('gtranslate-style', $wp_plugin_url.'/gtranslate-style'.$data['flag_size'].'.css');
To:
wp_enqueue_style( 'gtranslate-style', plugins_url('gtranslate-style'.$data['flag_size'].'.css', __FILE__) );
Since WP_CONTENT_URL may be modified in the wp-config… or use WP_PLUGIN_URL
but it’s recommended to use plugins_url().Run WordPress in debug mode and fix the php strict warnings as of php 5.0.0
Kind regards,
Martijn
- The topic ‘Enqueue the css stylesheet in a more proper way’ is closed to new replies.