|
@@ 158-174 (lines=17) @@
|
| 155 |
|
* Scripts |
| 156 |
|
*/ |
| 157 |
|
|
| 158 |
|
public function register_concat_scripts( $tag, $handle, $src ) { |
| 159 |
|
global $wp_scripts; |
| 160 |
|
|
| 161 |
|
// don't do admin for now |
| 162 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 163 |
|
return $tag; |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
$script = $wp_scripts->registered[$handle]; |
| 167 |
|
|
| 168 |
|
if ( $this->should_concat_script( $script ) ) { |
| 169 |
|
$this->buffer_script( $script ); |
| 170 |
|
return ''; |
| 171 |
|
} |
| 172 |
|
|
| 173 |
|
// TODO: if this script is dependent on one that has been buffered, we need to flush the concatenated |
| 174 |
|
// scripts and then output this script |
| 175 |
|
|
| 176 |
|
return $tag; |
| 177 |
|
} |
|
@@ 199-215 (lines=17) @@
|
| 196 |
|
* Styles |
| 197 |
|
*/ |
| 198 |
|
|
| 199 |
|
public function register_concat_styles( $tag, $handle, $href, $media ) { |
| 200 |
|
global $wp_styles; |
| 201 |
|
|
| 202 |
|
// don't do admin for now |
| 203 |
|
if ( is_admin() || ! isset( $wp_styles->registered[$handle] ) ) { |
| 204 |
|
return $tag; |
| 205 |
|
} |
| 206 |
|
|
| 207 |
|
$style = $wp_styles->registered[$handle]; |
| 208 |
|
|
| 209 |
|
if ( $this->should_concat_style( $style ) ) { |
| 210 |
|
$this->buffer_style( $style ); |
| 211 |
|
return ''; |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
return $tag; |
| 215 |
|
} |
| 216 |
|
|
| 217 |
|
private function buffer_style( $style ) { |
| 218 |
|
$group = isset( $style->extra['group'] ) ? $style->extra['group'] : 0; |