Fix notices/usage of closures as action/filter handlers. Fixes #10493 based on patch from scribu.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
249a6cdd18
commit
86cb0aa6b9
|
@ -737,8 +737,13 @@ function _wp_filter_build_unique_id($tag, $function, $priority) {
|
||||||
if ( is_string($function) )
|
if ( is_string($function) )
|
||||||
return $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]) ) {
|
if (is_object($function[0]) ) {
|
||||||
// Object Class Calling
|
// Object Class Calling
|
||||||
if ( function_exists('spl_object_hash') ) {
|
if ( function_exists('spl_object_hash') ) {
|
||||||
|
|
Loading…
Reference in New Issue