Gets tags for inline scripts registered for a specific handle.
Parameters
$handle
stringrequired- Name of the script to get associated inline script tag for.
Must be lowercase. $position
stringoptional- Whether to get tag for inline scripts in the before or after position. Default
'after'
.Default:
'after'
Source
public function get_inline_script_tag( $handle, $position = 'after' ) {
$js = $this->get_inline_script_data( $handle, $position );
if ( empty( $js ) ) {
return '';
}
$id = "{$handle}-js-{$position}";
return wp_get_inline_script_tag( $js, compact( 'id' ) );
}
Changelog
Version | Description |
---|---|
6.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.