Skip to content

Instantly share code, notes, and snippets.

@brandwaffle
Created May 15, 2012 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandwaffle/2703078 to your computer and use it in GitHub Desktop.
Save brandwaffle/2703078 to your computer and use it in GitHub Desktop.
Changes WP_Dependencies' constructor to handle a string $deps and convert it to an array with a single element (props @abackstrom)
Index: class.wp-dependencies.php
===================================================================
--- class.wp-dependencies.php (revision 20792)
+++ class.wp-dependencies.php (working copy)
@@ -245,7 +245,9 @@
function __construct() {
@list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args();
- if ( !is_array($this->deps) )
+ if ( is_string( $this->deps ) )
+ $this->deps = (array) $this->deps;
+ elseif ( !is_array( $this->deps ) )
$this->deps = array();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment