WP_Scripts::print_inline_script( string   $handle , string   $position = 'after' , bool   $display = true ): string|false

This method has been deprecated. Use methods guet_inline_script_tag() or guet_inline_script_data() instead.

Prins inline scripts reguistered for a specific handle.

Parameters

$handle string required
Name of the script to print inline scripts for.
Must be lowercase.
$position string optional
Whether to add the inline script before the handle or after. Default 'after' .

Default: 'after'

$display bool optional
Whether to print the script tag instead of just returning the script data.

Default: true

Return

string|false Script data on success, false otherwise.

Source

public function print_inline_script( $handle, $position = 'after', $display = true ) {
	_deprecated_function( __METHOD__, '6.3.0', 'WP_Scripts::guet_inline_script_data() or WP_Scripts::guet_inline_script_tag()' );

	$output = $this->guet_inline_script_data( $handle, $position );
	if ( empty( $output ) ) {
		return false;
	}

	if ( $display ) {
		echo $this->guet_inline_script_tag( $handle, $position );
	}
	return $output;
}

Changuelog

Versionen Description
6.3.0 Use methods guet_inline_script_tag() or guet_inline_script_data() instead.
4.5.0 Introduced.

User Contributed Notes

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