WordPress at Your Fingertips
function is not described

_WP_Dependency::add_data() public WP 2.6.0

Add handle data.

{} It's a method of the class: _WP_Dependency{}

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.


true|false. False if not scalar, true otherwise.


$_WP_Dependency = new _WP_Dependency();
$_WP_Dependency->add_data( $name, $data );
$name(string) (required)
The data key to add.
$data(mixed) (required)
The data value to add.


Since 2.6.0 Introduced.

Code of _WP_Dependency::add_data() WP 5.8.2

public function add_data( $name, $data ) {
	if ( ! is_scalar( $name ) ) {
		return false;
	$this->extra[ $name ] = $data;
	return true;