wp enqueue style - Scripts and stylesheets failing to load in Chrome IOS (and only Chrome IOS)

My script and stylesheet files have been failing to load in Chrome IOS, and only Chrome IOS. I changing the value of $ve

My script and stylesheet files have been failing to load in Chrome IOS, and only Chrome IOS. I changing the value of $ver in wp_register_script from a string with a value ("1.0.17") to an empty string, and this caused the problem to clear up. I changed it back, and that caused the problem to happen again, but when I did that process a second time the problem didn't occur, and now I can't reproduce it.

Does anybody know what might be going on with this, and how I can prevent it from happening in the future?

class Queue{
    private $cssVer = "1.0.43";
    // Chrome breaker?
    private $jsVer = "1.0.17";

    function __construct() {
        $this->suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
        $this->add_actions();
    } 
    public function add_actions(){
        add_action( 'wp_enqueue_scripts',array( $this, 'queue_all' ),20 );
    }
    public function queue_all(){
        $this->queue_scripts();
        $this->queue_styles();
    }
    private function queue_styles(){
        $this->enqueue_all_css();
    }
    private  function queue_scripts(){
        $this->enqueue_custom_js();
    }
    private function enqueue_all_css(){
        wp_register_style('style-label', 
            get_stylesheet_directory_uri().'/folder/filename'.$this->suffix.'.css', 
            null, 
            $this->cssVer, 
            "all"
        );
        wp_enqueue_style( 'style-label',1 );
    }
    private function enqueue_custom_js(){
            wp_register_script('label-js', 
                get_stylesheet_directory_uri().'/folder/file'.$this->suffix.'.js', 
                ['jquery'], 
                $this->jsVer, 
                false
            );
            wp_enqueue_script( 'label-js' );
        }
    }
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745467732a4628988.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信