|
@@ 153-169 (lines=17) @@
|
| 150 |
|
* Scripts |
| 151 |
|
*/ |
| 152 |
|
|
| 153 |
|
public function register_concat_scripts( $tag, $handle, $src ) { |
| 154 |
|
global $wp_scripts; |
| 155 |
|
|
| 156 |
|
// don't do admin for now |
| 157 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 158 |
|
return $tag; |
| 159 |
|
} |
| 160 |
|
|
| 161 |
|
$script = $wp_scripts->registered[$handle]; |
| 162 |
|
|
| 163 |
|
if ( $this->should_concat_script( $script ) ) { |
| 164 |
|
$this->buffer_script( $script ); |
| 165 |
|
return ''; |
| 166 |
|
} |
| 167 |
|
|
| 168 |
|
return $tag; |
| 169 |
|
} |
| 170 |
|
|
| 171 |
|
private function should_concat_script( $script ) { |
| 172 |
|
// only concat local scripts |
|
@@ 191-207 (lines=17) @@
|
| 188 |
|
* Styles |
| 189 |
|
*/ |
| 190 |
|
|
| 191 |
|
public function register_concat_styles( $tag, $handle, $href, $media ) { |
| 192 |
|
global $wp_styles; |
| 193 |
|
|
| 194 |
|
// don't do admin for now |
| 195 |
|
if ( is_admin() || ! isset( $wp_styles->registered[$handle] ) ) { |
| 196 |
|
return $tag; |
| 197 |
|
} |
| 198 |
|
|
| 199 |
|
$style = $wp_styles->registered[$handle]; |
| 200 |
|
|
| 201 |
|
if ( $this->should_concat_style( $style ) ) { |
| 202 |
|
$this->buffer_style( $style ); |
| 203 |
|
return ''; |
| 204 |
|
} |
| 205 |
|
|
| 206 |
|
return $tag; |
| 207 |
|
} |
| 208 |
|
|
| 209 |
|
private function buffer_style( $style ) { |
| 210 |
|
$group = isset( $style->extra['group'] ) ? $style->extra['group'] : 0; |