• Resolved Matt

    (@syntax53)


    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);
    }

    https://www.ads-software.com/plugins/html5shiv/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ramoonus

    (@ramoonus)

    i see no reason why it would detect the wordpress version

    Thread Starter Matt

    (@syntax53)

    What? I was stating the fact that your plugin simply doesn’t do anything as released. There is nothing anywhere that actually makes it load and do anything.

    Plugin Author Ramoonus

    (@ramoonus)

    it enqueues a javascript which does the work

    Thread Starter Matt

    (@syntax53)

    Englighten on how it gets queued up. Your plugin’s PHP contains this:

    function rw_html5shiv() {
    
    		// Original
    		wp_deregister_script('html5shiv'); // deregister
    		//wp_enqueue_script('html5shiv', plugins_url('/js/html5shiv.min.js', __FILE__), false, '3.7.2');
    
    		// With Printshiv
    		wp_deregister_script('html5shiv-printshiv'); // deregister
    		wp_enqueue_script('html5shiv-printshiv', plugins_url('/js/html5shiv-printshiv.min.js', __FILE__), false, '3.7.2');
    }

    Yet nothing actually calls rw_html5shiv, so it never does anything.

    Plugin Author Ramoonus

    (@ramoonus)

    that`s a bug indeed, will fix it straight away

    Plugin Author Ramoonus

    (@ramoonus)

    fixed in 3.7.2.1

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Plugin doesn't load??’ is closed to new replies.