WP_Scripts::localize

SummerySummery

Localizes a script, only if the script has already been added.

Syntax

WP_Scripts::localize( string $handle, string $object_name, array $l10n )

ParametersParameters

$handle

(string) (Required) Name of the script to attach data to.

$object_name

(string) (Required) Name of the variable that will contain the data.

$l10n

(array) (Required) Array of data to localize.

ReturnReturn

(bool) True on success, false on failure.

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
2.1.0 Introduced.
Scroll to Top