|
@@ 319-334 (lines=16) @@
|
| 316 |
|
} |
| 317 |
|
|
| 318 |
|
/** SCRIPTS **/ |
| 319 |
|
public function filter_inline_scripts( $src, $handle ) { |
| 320 |
|
global $wp_scripts; |
| 321 |
|
|
| 322 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 323 |
|
return $src; |
| 324 |
|
} |
| 325 |
|
|
| 326 |
|
$script = $wp_scripts->registered[$handle]; |
| 327 |
|
|
| 328 |
|
// reset src to empty - can't return empty string though because then it skips rendering the tag |
| 329 |
|
if ( $this->should_inline_script( $script ) ) { |
| 330 |
|
return '#'; |
| 331 |
|
} |
| 332 |
|
|
| 333 |
|
return $src; |
| 334 |
|
} |
| 335 |
|
|
| 336 |
|
public function print_inline_scripts( $tag, $handle, $src ) { |
| 337 |
|
global $wp_scripts; |
|
@@ 422-436 (lines=15) @@
|
| 419 |
|
} |
| 420 |
|
|
| 421 |
|
/** STYLES **/ |
| 422 |
|
public function filter_inline_styles( $src, $handle ) { |
| 423 |
|
global $wp_scripts; |
| 424 |
|
|
| 425 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 426 |
|
return $src; |
| 427 |
|
} |
| 428 |
|
|
| 429 |
|
$style = $wp_scripts->registered[$handle]; |
| 430 |
|
|
| 431 |
|
if ( $this->should_inline_style( $style ) ) { |
| 432 |
|
return '#'; |
| 433 |
|
} |
| 434 |
|
|
| 435 |
|
return $src; |
| 436 |
|
} |
| 437 |
|
|
| 438 |
|
public function print_inline_styles( $tag, $handle, $href, $media ) { |
| 439 |
|
global $wp_styles; |