Allow people to attach PHP 5.3 Closures to filters and actions. Fixes #10493 props scribu.

git-svn-id: https://develop.svn.wordpress.org/trunk@12641 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2010-01-07 08:27:02 +00:00
parent ee63362624
commit 754fe19661
1 changed files with 6 additions and 3 deletions

View File

@ -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]) ) {