Add CSS minification, AJAX settings, and modern admin styling
This commit is contained in:
@ -15,4 +15,18 @@ function wpa_superstar_lazy_load_images( $content ) {
|
||||
return $content;
|
||||
}
|
||||
add_filter( 'the_content', 'wpa_superstar_lazy_load_images' );
|
||||
add_filter( 'wp_get_attachment_image', 'wpa_superstar_lazy_load_images' );
|
||||
add_filter( 'wp_get_attachment_image', 'wpa_superstar_lazy_load_images' );
|
||||
|
||||
// After lazy load function
|
||||
function wpa_superstar_minify_css( $html ) {
|
||||
if ( is_admin() || ! get_option( 'wpa_superstar_minify_css', 0 ) ) {
|
||||
return $html;
|
||||
}
|
||||
$html = preg_replace(
|
||||
array( '/\s+/', '/\/\*.*?\*\//s', '/;}/' ),
|
||||
array( ' ', '', '}' ),
|
||||
$html
|
||||
);
|
||||
return trim( $html );
|
||||
}
|
||||
add_filter( 'style_loader_tag', 'wpa_superstar_minify_css' );
|
Reference in New Issue
Block a user