Make WordPress Core

Ticket #10535: 10535.2.diff

File 10535.2.diff, 1.5 KB (added by dd32, 15 years ago)
  • wp-includes/plugin.php

     
    675675        global $wp_filter;
    676676        static $filter_id_count = 0;
    677677
    678         // If function then just skip all of the tests and not overwrite the following.
    679         if ( is_string($function) )
     678        if ( is_string($function) ) { // If function then just skip all of the tests and not overwrite the following.
    680679                return $function;
    681         // Object Class Calling
    682         else if (is_object($function[0]) ) {
     680        } else if (is_object($function[0]) ) { // Object Class Calling
     681                if ( function_exists('spl_object_hash') )
     682                        return spl_object_hash($function[0]) . $function[1];
    683683                $obj_idx = get_class($function[0]).$function[1];
    684684                if ( !isset($function[0]->wp_filter_id) ) {
    685685                        if ( false === $priority )
    686686                                return false;
    687                         $obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : 0;
    688                         $function[0]->wp_filter_id = $filter_id_count++;
    689                 } else
     687                        $obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : $filter_id_count;
     688                        $function[0]->wp_filter_id = $filter_id_count;
     689                        ++$filter_id_count;
     690                } else {
    690691                        $obj_idx .= $function[0]->wp_filter_id;
     692                }
     693
    691694                return $obj_idx;
     695        } else if ( is_string($function[0]) ) { // Static Calling
     696                return $function[0].$function[1];
    692697        }
    693         // Static Calling
    694         else if ( is_string($function[0]) )
    695                 return $function[0].$function[1];
    696698}
    697699
    698700?>