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
This commit is contained in:
westi 2010-01-07 08:27:02 +00:00
parent a3e49fff6e
commit c30c392e91
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]) ) {