|
@@ 187-202 (lines=16) @@
|
| 184 |
|
} |
| 185 |
|
|
| 186 |
|
/** SCRIPTS **/ |
| 187 |
|
public function filter_inline_scripts( $src, $handle ) { |
| 188 |
|
global $wp_scripts; |
| 189 |
|
|
| 190 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 191 |
|
return $src; |
| 192 |
|
} |
| 193 |
|
|
| 194 |
|
$script = $wp_scripts->registered[$handle]; |
| 195 |
|
|
| 196 |
|
// reset src to empty - can't return empty string though because then it skips rendering the tag |
| 197 |
|
if ( $this->should_inline_script( $script ) ) { |
| 198 |
|
return '#'; |
| 199 |
|
} |
| 200 |
|
|
| 201 |
|
return $src; |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
public function print_inline_scripts( $tag, $handle, $src ) { |
| 205 |
|
global $wp_scripts; |
|
@@ 267-281 (lines=15) @@
|
| 264 |
|
} |
| 265 |
|
|
| 266 |
|
/** STYLES **/ |
| 267 |
|
public function filter_inline_styles( $src, $handle ) { |
| 268 |
|
global $wp_scripts; |
| 269 |
|
|
| 270 |
|
if ( is_admin() || ! isset( $wp_scripts->registered[$handle] ) ) { |
| 271 |
|
return $src; |
| 272 |
|
} |
| 273 |
|
|
| 274 |
|
$style = $wp_scripts->registered[$handle]; |
| 275 |
|
|
| 276 |
|
if ( $this->should_inline_style( $style ) ) { |
| 277 |
|
return '#'; |
| 278 |
|
} |
| 279 |
|
|
| 280 |
|
return $src; |
| 281 |
|
} |
| 282 |
|
|
| 283 |
|
public function print_inline_styles( $tag, $handle, $href, $media ) { |
| 284 |
|
global $wp_styles; |