将以下代码添加到功能中。php文件:
// Remove Query Strings
function _remove_script_version( $src ){
$parts = explode( \'?ver\', $src );
return $parts[0];
}
add_filter( \'script_loader_src\', \'_remove_script_version\', 15, 1 );
add_filter( \'style_loader_src\', \'_remove_script_version\', 15, 1 );
// Remove jquery migrate
function dequeue_jquery_migrate( $scripts ) {
if ( ! is_admin() && ! empty( $scripts->registered[\'jquery\'] ) ) {
$scripts->registered[\'jquery\']->deps = array_diff(
$scripts->registered[\'jquery\']->deps,
[ \'jquery-migrate\' ]
);
}
}
add_action( \'wp_default_scripts\', \'dequeue_jquery_migrate\' );