From c2374d2d0568fa131b3f4568e63a7bcff28cb238 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Sat, 4 Aug 2012 17:59:55 +0000 Subject: [PATCH] Let WP_Dependencies accept a string for a single dependency instead of requiring an array wrapper. props vhauri. fixes #20683 git-svn-id: https://develop.svn.wordpress.org/trunk@21420 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class.wp-dependencies.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php index fb1f1ee0c2..adc0157490 100644 --- a/wp-includes/class.wp-dependencies.php +++ b/wp-includes/class.wp-dependencies.php @@ -245,7 +245,9 @@ class _WP_Dependency { 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(); }