WP_Scripts::has_inline_script() – Method | Developer.WordPress.org
Gets data for inline scripts registered for a specific handle.
Parameters
$handlestringrequiredName of the script to get data for. Must be lowercase.
$positionstringoptionalThe position of the inline script.
Default:
null
Return
bool Whether the handle has an inline script (either before or after).Source
private function has_inline_script( $handle, $position = null ) {
if ( $position && in_array( $position, array( 'before', 'after' ), true ) ) {
return (bool) $this->get_data( $handle, $position );
}
return (bool) ( $this->get_data( $handle, 'before' ) || $this->get_data( $handle, 'after' ) );
}
Changelog
| Version | Description |
|---|---|
| 6.3.0 | Introduced. |