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:
parent
a3e49fff6e
commit
c30c392e91
|
@ -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]) ) {
|
||||
|
|
Loading…
Reference in New Issue