📜  wordpress 禁用 jquery 迁移 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:38.462000             🧑  作者: Mango

代码示例1
PHPfunction remove_jquery_migrate( $scripts ) {
    
    if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
            
        $script = $scripts->registered['jquery'];
        
        if ( $script->deps ) { 
            $script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) );
        }
    }
}
add_action( 'wp_default_scripts', 'remove_jquery_migrate' );