|
@@ 143-159 (lines=17) @@
|
| 140 |
|
* Scripts |
| 141 |
|
*/ |
| 142 |
|
|
| 143 |
|
public function register_concat_scripts( $tag, $handle, $src ) { |
| 144 |
|
global $wp_scripts; |
| 145 |
|
|
| 146 |
|
// don't do admin for now |
| 147 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 148 |
|
return $tag; |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
$script = $wp_scripts->registered[$handle]; |
| 152 |
|
|
| 153 |
|
if ( $this->should_concat_script( $script ) ) { |
| 154 |
|
$this->buffer_script( $script ); |
| 155 |
|
return ''; |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
return $tag; |
| 159 |
|
} |
| 160 |
|
|
| 161 |
|
private function should_concat_script( $script ) { |
| 162 |
|
// only concat local scripts |
|
@@ 181-197 (lines=17) @@
|
| 178 |
|
* Styles |
| 179 |
|
*/ |
| 180 |
|
|
| 181 |
|
public function register_concat_styles( $tag, $handle, $href, $media ) { |
| 182 |
|
global $wp_styles; |
| 183 |
|
|
| 184 |
|
// don't do admin for now |
| 185 |
|
if ( is_admin() || ! isset( $wp_styles->registered[$handle] ) ) { |
| 186 |
|
return $tag; |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
$style = $wp_styles->registered[$handle]; |
| 190 |
|
|
| 191 |
|
if ( $this->should_concat_style( $style ) ) { |
| 192 |
|
$this->buffer_style( $style ); |
| 193 |
|
return ''; |
| 194 |
|
} |
| 195 |
|
|
| 196 |
|
return $tag; |
| 197 |
|
} |
| 198 |
|
|
| 199 |
|
private function buffer_style( $style ) { |
| 200 |
|
$group = isset( $style->extra['group'] ) ? $style->extra['group'] : 0; |