_WP_Dependency::add_data()publicWP 2.6.0

Add handle data.

Method of the class: _WP_Dependency{}

No Hooks.

Return

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

Usage

$_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.

Changelog

Since 2.6.0 Introduced.

_WP_Dependency::add_data() code WP 6.5.4

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