WP_Dependencies::add_data
Add extra item data.
Adds data to a registered item.
Method of the class: WP_Dependencies{}
No Hooks.
Returns
true|false. True on success, false on failure.
Usage
$WP_Dependencies = new WP_Dependencies(); $WP_Dependencies->add_data( $handle, $key, $value );
- $handle(string) (required)
- Name of the item. Should be unique.
- $key(string) (required)
- The data key.
- $value(mixed) (required)
- The data value.
Changelog
| Since 2.6.0 | Introduced. |
WP_Dependencies::add_data() WP Dependencies::add data code WP 6.9.1
public function add_data( $handle, $key, $value ) {
if ( ! isset( $this->registered[ $handle ] ) ) {
return false;
}
if ( 'conditional' === $key && '_required-conditional-dependency_' !== $value ) {
_deprecated_argument(
'WP_Dependencies->add_data()',
'6.9.0',
__( 'IE conditional comments are ignored by all supported browsers.' )
);
}
return $this->registered[ $handle ]->add_data( $key, $value );
}