Prints extra scripts of a registered script.
Parameters
$handle
stringrequired- The script’s registered handle.
$display
booloptional- Whether to print the extra script instead of just returning it.
Default:
true
Source
public function print_extra_script( $handle, $display = true ) {
$output = $this->get_data( $handle, 'data' );
if ( ! $output ) {
return;
}
if ( ! $display ) {
return $output;
}
wp_print_inline_script_tag( $output, array( 'id' => "{$handle}-js-extra" ) );
return true;
}
Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.