3 * Dependencies API: _WP_Dependency class
8 * @subpackage Dependencies
12 * Class _WP_Dependency
14 * Helper class to register a handle and associated data.
19 class _WP_Dependency {
39 * An array of handle dependencies.
45 public $deps = array();
50 * Used for cache-busting.
59 * Additional arguments for the handle.
65 public $args = null; // Custom property, such as $in_footer or $media.
68 * Extra data to supply to the handle.
74 public $extra = array();
81 public function __construct() {
82 @list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args();
83 if ( ! is_array($this->deps) )
84 $this->deps = array();
93 * @param string $name The data key to add.
94 * @param mixed $data The data value to add.
95 * @return bool False if not scalar, true otherwise.
97 public function add_data( $name, $data ) {
98 if ( !is_scalar($name) )
100 $this->extra[$name] = $data;