WPDev.one
Core Function
View Source on Trac ↗

wp_script_add_data()

wp_script_add_data( mixed $handle, mixed $key, mixed $value )

Adds metadata to a script.

Parameters 3 required

Name / Type Description
$handle
string

Name of the script.

Required
$key
string

Name of data point for which we're storing a value.

Required
$value
mixed

String containing the data to be added.

Required

Return Value

(bool)
True on success, false on failure.

Function Information

Since Version
4.2.0
Source File
wp-includes/functions.wp-scripts.php
Advertisement