-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminit-min.php
36 lines (28 loc) · 939 Bytes
/
minit-min.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/*
Plugin Name: Minit Min
Plugin URI: https://github.com/bjornjohansen/minit-min
Description: Adds minification to the Minit plugin by Kaspars Dambis
Version: 0.0.1
Author: Bjørn Johansen
Author URI: https://bjornjohansen.no
*/
if ( ! class_exists( 'Minify_CSS_Compressor' ) ) {
require_once( 'Minify_CSS_Compressor/Compressor.php' );
}
if ( ! class_exists( '\\JShrink\\Minifier' ) ) {
require_once( 'JShrink/Minifier.php' );
}
new Minit_Min;
class Minit_Min {
function __construct() {
add_filter( 'minit-content-css', array( $this, 'minit_content_css' ), 11, 3 );
add_filter( 'minit-content-js', array( $this, 'minit_content_js' ), 11, 3 );
}
public function minit_content_css( $content = '', $object = '', $script = '' ) {
return Minify_CSS_Compressor::process( $content );
}
public function minit_content_js( $content = '', $object = '', $script = '' ) {
return \JShrink\Minifier::minify( $content );
}
}