From c30c392e911e972bf091ae257b99d82b0fc35ae9 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 7 Jan 2010 08:27:02 +0000 Subject: [PATCH] Allow people to attach PHP 5.3 Closures to filters and actions. Fixes #10493 props scribu. git-svn-id: http://svn.automattic.com/wordpress/trunk@12641 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/plugin.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index cf92494d1..3e212e2ba 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -681,9 +681,12 @@ function _wp_filter_build_unique_id($tag, $function, $priority) { global $wp_filter; static $filter_id_count = 0; - if ( is_string($function) ) { + if ( is_string($function) ) return $function; - } else if (is_object($function[0]) ) { + + $function = (array) $function; + + if (is_object($function[0]) ) { // Object Class Calling if ( function_exists('spl_object_hash') ) { return spl_object_hash($function[0]) . $function[1]; @@ -698,7 +701,7 @@ function _wp_filter_build_unique_id($tag, $function, $priority) { } else { $obj_idx .= $function[0]->wp_filter_id; } - + return $obj_idx; } } else if ( is_string($function[0]) ) {