WP_Scripts::has_inline_script() – Method | Developer.WordPress.org

Gets data for inline scripts registered for a specific handle.

Parameters

$handlestringrequired

Name of the script to get data for. Must be lowercase.

$positionstringoptional

The 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' ) );
}

View all references View on Trac View on GitHub

Changelog

VersionDescription
6.3.0Introduced.