_WP_Dependency

Class _WP_Dependency.

Defined (1)

The class is defined in the following location(s).

/wp-includes/class-wp-dependency.php  
  1. class _WP_Dependency { 
  2. /** 
  3. * The handle name. 
  4. * @access public 
  5. * @since 2.6.0 
  6. * @var null 
  7. */ 
  8. public $handle; 
  9.  
  10. /** 
  11. * The handle source. 
  12. * @access public 
  13. * @since 2.6.0 
  14. * @var null 
  15. */ 
  16. public $src; 
  17.  
  18. /** 
  19. * An array of handle dependencies. 
  20. * @access public 
  21. * @since 2.6.0 
  22. * @var array 
  23. */ 
  24. public $deps = array(); 
  25.  
  26. /** 
  27. * The handle version. 
  28. * Used for cache-busting. 
  29. * @access public 
  30. * @since 2.6.0 
  31. * @var bool|string 
  32. */ 
  33. public $ver = false; 
  34.  
  35. /** 
  36. * Additional arguments for the handle. 
  37. * @access public 
  38. * @since 2.6.0 
  39. * @var null 
  40. */ 
  41. public $args = null; // Custom property, such as $in_footer or $media. 
  42.  
  43. /** 
  44. * Extra data to supply to the handle. 
  45. * @access public 
  46. * @since 2.6.0 
  47. * @var array 
  48. */ 
  49. public $extra = array(); 
  50.  
  51. /** 
  52. * Setup dependencies. 
  53. * @since 2.6.0 
  54. */ 
  55. public function __construct() { 
  56. @list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args(); 
  57. if ( ! is_array($this->deps) ) 
  58. $this->deps = array(); 
  59.  
  60. /** 
  61. * Add handle data. 
  62. * @access public 
  63. * @since 2.6.0 
  64. * @param string $name The data key to add. 
  65. * @param mixed $data The data value to add. 
  66. * @return bool False if not scalar, true otherwise. 
  67. */ 
  68. public function add_data( $name, $data ) { 
  69. if ( !is_scalar($name) ) 
  70. return false; 
  71. $this->extra[$name] = $data; 
  72. return true; 
  73.