Add JS minification and tabbed admin UI
This commit is contained in:
@ -28,4 +28,17 @@ function wpa_superstar_minify_css( $html ) {
|
||||
);
|
||||
return trim( $html );
|
||||
}
|
||||
add_filter( 'style_loader_tag', 'wpa_superstar_minify_css' );
|
||||
add_filter( 'style_loader_tag', 'wpa_superstar_minify_css' );
|
||||
|
||||
function wpa_superstar_minify_js( $html ) {
|
||||
if ( is_admin() || ! get_option( 'wpa_superstar_minify_js', 0 ) ) {
|
||||
return $html;
|
||||
}
|
||||
$html = preg_replace(
|
||||
array( '/\s+/', '/\/\*.*?\*\//s', '//.*?\n/' ),
|
||||
array( ' ', '', '' ),
|
||||
$html
|
||||
);
|
||||
return trim( $html );
|
||||
}
|
||||
add_filter( 'script_loader_tag', 'wpa_superstar_minify_js' );
|
Reference in New Issue
Block a user