X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/596d585e1dc1eb25bccd3781e37210a4e2504179..6c8f14c09105d0afa4c1574215c59b5021040e76:/wp-includes/class.wp-dependencies.php diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php index fb1f1ee0..eb075c85 100644 --- a/wp-includes/class.wp-dependencies.php +++ b/wp-includes/class.wp-dependencies.php @@ -196,24 +196,27 @@ class WP_Dependencies { } } - function query( $handle, $list = 'registered' ) { // registered, queue, done, to_do - switch ( $list ) : - case 'registered': - case 'scripts': // back compat - if ( isset($this->registered[$handle]) ) - return $this->registered[$handle]; - break; - case 'to_print': // back compat - case 'printed': // back compat - if ( 'to_print' == $list ) - $list = 'to_do'; - else - $list = 'printed'; - default: - if ( in_array($handle, $this->$list) ) - return true; - break; - endswitch; + + function query( $handle, $list = 'registered' ) { + switch ( $list ) { + case 'registered' : + case 'scripts': // back compat + if ( isset( $this->registered[ $handle ] ) ) + return $this->registered[ $handle ]; + return false; + + case 'enqueued' : + case 'queue' : + return in_array( $handle, $this->queue ); + + case 'to_do' : + case 'to_print': // back compat + return in_array( $handle, $this->to_do ); + + case 'done' : + case 'printed': // back compat + return in_array( $handle, $this->done ); + } return false; } @@ -244,8 +247,8 @@ class _WP_Dependency { var $extra = array(); function __construct() { - @list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args(); - if ( !is_array($this->deps) ) + @list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args(); + if ( ! is_array($this->deps) ) $this->deps = array(); }