这里有一个
// Defer parsing of JavaScript files.
function any_page_first_defer_javascripts ( $url ) {
if ( FALSE === strpos( $url, \'.js\' ) ) {
return $url;
}
return "$url\' async=\'async";
}
add_filter( \'clean_url\', \'any_page_first_defer_javascripts\', 11, 1 );
这是另一个
// Remove Query strings from Static Resources.
function any_page_first_remove_script_version( $src ){
return add_query_arg( \'ver\', false, $src );
}
add_filter( \'script_loader_src\', \'any_page_first_remove_script_version\', 15, 1 );
add_filter( \'style_loader_src\', \'any_page_first__remove_script_version\', 15, 1 );