Make WordPress Core

Ticket #10535: 10535.diff

File 10535.diff, 1.4 KB (added by dd32, 16 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
    683681                $obj_idx = get_class($function[0]).$function[1];
    684682                if ( !isset($function[0]->wp_filter_id) ) {
    685683                        if ( false === $priority )
    686684                                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
     685                        $obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : $filter_id_count;
     686                        $function[0]->wp_filter_id = $filter_id_count;
     687                        ++$filter_id_count;
     688                } else {
    690689                        $obj_idx .= $function[0]->wp_filter_id;
     690                }
     691
    691692                return $obj_idx;
     693        } else if ( is_string($function[0]) ) { // Static Calling
     694                return $function[0].$function[1];
    692695        }
    693         // Static Calling
    694         else if ( is_string($function[0]) )
    695                 return $function[0].$function[1];
    696696}
    697697
    698698?>