diff --git a/src/wp-includes/class-wp-dependency.php b/src/wp-includes/class-wp-dependency.php new file mode 100644 index 0000000000..92c5456172 --- /dev/null +++ b/src/wp-includes/class-wp-dependency.php @@ -0,0 +1,104 @@ +handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args(); + if ( ! is_array($this->deps) ) + $this->deps = array(); + } + + /** + * Add handle data. + * + * @access public + * @since 2.6.0 + * + * @param string $name The data key to add. + * @param mixed $data The data value to add. + * @return bool False if not scalar, true otherwise. + */ + public function add_data( $name, $data ) { + if ( !is_scalar($name) ) + return false; + $this->extra[$name] = $data; + return true; + } + +} diff --git a/src/wp-includes/class.wp-dependencies.php b/src/wp-includes/class.wp-dependencies.php index 03484181cf..13ff04fa5a 100644 --- a/src/wp-includes/class.wp-dependencies.php +++ b/src/wp-includes/class.wp-dependencies.php @@ -211,7 +211,7 @@ class WP_Dependencies { * as a query string for cache busting purposes. If version is set to false, a version * number is automatically added equal to current installed WordPress version. * If set to null, no version is added. - * @param mixed $args Optional. Custom property of the item. NOT the class property $args. Examples: $media, $in_footer. + * @param mixed $args Optional. Custom property of the item. NOT the class property $args. Examples: $media, $in_footer. * @return bool Whether the item has been registered. True on success, false on failure. */ public function add( $handle, $src, $deps = array(), $ver = false, $args = null ) { @@ -411,99 +411,4 @@ class WP_Dependencies { return true; } -} // WP_Dependencies - -/** - * Class _WP_Dependency - * - * Helper class to register a handle and associated data. - * - * @access private - * @since 2.6.0 - */ -class _WP_Dependency { - /** - * The handle name. - * - * @access public - * @since 2.6.0 - * @var null - */ - public $handle; - - /** - * The handle source. - * - * @access public - * @since 2.6.0 - * @var null - */ - public $src; - - /** - * An array of handle dependencies. - * - * @access public - * @since 2.6.0 - * @var array - */ - public $deps = array(); - - /** - * The handle version. - * - * Used for cache-busting. - * - * @access public - * @since 2.6.0 - * @var bool|string - */ - public $ver = false; - - /** - * Additional arguments for the handle. - * - * @access public - * @since 2.6.0 - * @var null - */ - public $args = null; // Custom property, such as $in_footer or $media. - - /** - * Extra data to supply to the handle. - * - * @access public - * @since 2.6.0 - * @var array - */ - public $extra = array(); - - /** - * Setup dependencies. - * - * @since 2.6.0 - */ - public function __construct() { - @list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args(); - if ( ! is_array($this->deps) ) - $this->deps = array(); - } - - /** - * Add handle data. - * - * @access public - * @since 2.6.0 - * - * @param string $name The data key to add. - * @param mixed $data The data value to add. - * @return bool False if not scalar, true otherwise. - */ - public function add_data( $name, $data ) { - if ( !is_scalar($name) ) - return false; - $this->extra[$name] = $data; - return true; - } - -} // _WP_Dependencies +} diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 22f8f2b8b2..c60cfa6cf7 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -16,6 +16,9 @@ * @package WordPress */ +/** WordPress Dependency Class */ +require( ABSPATH . WPINC . '/class-wp-dependency.php' ); + /** WordPress Dependencies Class */ require( ABSPATH . WPINC . '/class.wp-dependencies.php' );