WP_Scripts::has_inline_script( string $handle, string $position = null ): bool

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

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

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.