WordPress.org

Make WordPress Core

Changeset 12641


Ignore:
Timestamp:
01/07/2010 08:27:02 AM (9 years ago)
Author:
westi
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/plugin.php

    r12464 r12641  
    682682    static $filter_id_count = 0;
    683683
    684     if ( is_string($function) ) {
     684    if ( is_string($function) )
    685685        return $function;
    686     } else if (is_object($function[0]) ) {
     686
     687    $function = (array) $function;
     688
     689    if (is_object($function[0]) ) {
    687690        // Object Class Calling
    688691        if ( function_exists('spl_object_hash') ) {
     
    699702                $obj_idx .= $function[0]->wp_filter_id;
    700703            }
    701    
     704
    702705            return $obj_idx;
    703706        }
Note: See TracChangeset for help on using the changeset viewer.