|
@@ 245-260 (lines=16) @@
|
| 242 |
|
} |
| 243 |
|
|
| 244 |
|
/** SCRIPTS **/ |
| 245 |
|
public function filter_inline_scripts( $src, $handle ) { |
| 246 |
|
global $wp_scripts; |
| 247 |
|
|
| 248 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 249 |
|
return $src; |
| 250 |
|
} |
| 251 |
|
|
| 252 |
|
$script = $wp_scripts->registered[$handle]; |
| 253 |
|
|
| 254 |
|
// reset src to empty - can't return empty string though because then it skips rendering the tag |
| 255 |
|
if ( $this->should_inline_script( $script ) ) { |
| 256 |
|
return '#'; |
| 257 |
|
} |
| 258 |
|
|
| 259 |
|
return $src; |
| 260 |
|
} |
| 261 |
|
|
| 262 |
|
public function print_inline_scripts( $tag, $handle, $src ) { |
| 263 |
|
global $wp_scripts; |
|
@@ 346-360 (lines=15) @@
|
| 343 |
|
} |
| 344 |
|
|
| 345 |
|
/** STYLES **/ |
| 346 |
|
public function filter_inline_styles( $src, $handle ) { |
| 347 |
|
global $wp_scripts; |
| 348 |
|
|
| 349 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 350 |
|
return $src; |
| 351 |
|
} |
| 352 |
|
|
| 353 |
|
$style = $wp_scripts->registered[$handle]; |
| 354 |
|
|
| 355 |
|
if ( $this->should_inline_style( $style ) ) { |
| 356 |
|
return '#'; |
| 357 |
|
} |
| 358 |
|
|
| 359 |
|
return $src; |
| 360 |
|
} |
| 361 |
|
|
| 362 |
|
public function print_inline_styles( $tag, $handle, $href, $media ) { |
| 363 |
|
global $wp_styles; |