From bfb56d204b09f1ad53dca3507ee45f8c176873bd Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sun, 16 May 2010 08:10:39 +0000 Subject: [PATCH] Fix notices/usage of closures as action/filter handlers. Fixes #10493 based on patch from scribu. git-svn-id: https://develop.svn.wordpress.org/trunk@14690 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/plugin.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index 709cdafc90..b8148c5185 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -737,8 +737,13 @@ function _wp_filter_build_unique_id($tag, $function, $priority) { if ( is_string($function) ) return $function; - $function = (array) $function; - + // Closures are currently implemented as objects + if ( is_object($function) ) { + $function = array( $function ); + } else { + $function = (array) $function; + } + if (is_object($function[0]) ) { // Object Class Calling if ( function_exists('spl_object_hash') ) {