Plugin doesn't load??
-
Maybe I’m missing something but I couldn’t find any directive in your plugin that tells it to load itself anywhere. I added the following function to html5shiv.php to do so:
function rw_html5shiv_conditional_queue() { global $wp_version; wp_deregister_script('html5shiv'); // deregister wp_deregister_script('html5shiv-printshiv'); // deregister wp_register_script('html5shiv-printshiv', plugins_url('/js/html5shiv-printshiv.min.js', __FILE__), false, '3.7.2'); if ( $wp_version >= 4.2 ) { //supposedly will be available in 4.2 global $wp_scripts; $wp_scripts->add_data( 'html5shiv-printshiv', 'conditional', 'lt IE 9' ); wp_enqueue_script('html5shiv-printshiv'); } else { global $is_IE; if( $is_IE ) { wp_enqueue_script('html5shiv-printshiv'); } } } if( !is_admin() ){ add_action('wp_enqueue_scripts', 'rw_html5shiv_conditional_queue', 99); }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Plugin doesn't load??’ is closed to new replies.