Make WordPress Core

Ticket #5163: add_filter-phpdoc.diff

File add_filter-phpdoc.diff, 1.6 KB (added by nbachiyski, 18 years ago)
  • wp-includes/plugin.php

     
    3535 * the <tt>$tag</a> parameter.
    3636 * @uses merge_filters Merges the filter hooks using this function.
    3737 * @param string $tag The name of the filter hook.
    38  * @param string $string The text on which the filters hooked to <tt>$tag</tt> are applied on.
     38 * @param mixed $value The value on which the filters hooked to <tt>$tag</tt> are applied on.
    3939 * @param mixed $var,... Additional variables passed to the functions hooked to <tt>$tag</tt>.
    40  * @return string The text in <tt>$string</tt> after all hooked functions are applied to it.
     40 * @return mixed The text in <tt>$mixed</tt> after all hooked functions are applied to it.
    4141 */
    42 function apply_filters($tag, $string) {
     42function apply_filters($tag, $value) {
    4343        global $wp_filter, $merged_filters;
    4444
    4545        if ( !isset( $merged_filters[ $tag ] ) )
    4646                merge_filters($tag);
    4747
    4848        if ( !isset($wp_filter[$tag]) )
    49                 return $string;
     49                return $value;
    5050
    5151        reset( $wp_filter[ $tag ] );
    5252
     
    5555        do{
    5656                foreach( (array) current($wp_filter[$tag]) as $the_ )
    5757                        if ( !is_null($the_['function']) ){
    58                                 $args[1] = $string;
    59                                 $string = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
     58                                $args[1] = $value;
     59                                $value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
    6060                        }
    6161
    6262        } while ( next($wp_filter[$tag]) !== false );
    6363
    64         return $string;
     64        return $value;
    6565}
    6666
    6767/**