WP_Scripts::add_inline_script

SummerySummery

Adds extra code to a registered script.

Syntax

WP_Scripts::add_inline_script( string $handle, string $data, string $position = 'after' )

ParametersParameters

$handle

(string) (Required) Name of the script to add the inline script to. Must be lowercase.

$data

(string) (Required) String containing the javascript to be added.

$position

(string) (Optional) Whether to add the inline script before the handle or after.

Default value: 'after'

ReturnReturn

(bool) True on success, false on failure.

SourceSource

File: wp-includes/class.wp-scripts.php


			

ChangelogChangelog

Changelog
Version Description
4.5.0 Introduced.
Scroll to Top