Ticket #5163: add_filter-phpdoc.diff
| File add_filter-phpdoc.diff, 1.6 KB (added by , 18 years ago) |
|---|
-
wp-includes/plugin.php
35 35 * the <tt>$tag</a> parameter. 36 36 * @uses merge_filters Merges the filter hooks using this function. 37 37 * @param string $tag The name of the filter hook. 38 * @param string $string The texton 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. 39 39 * @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. 41 41 */ 42 function apply_filters($tag, $ string) {42 function apply_filters($tag, $value) { 43 43 global $wp_filter, $merged_filters; 44 44 45 45 if ( !isset( $merged_filters[ $tag ] ) ) 46 46 merge_filters($tag); 47 47 48 48 if ( !isset($wp_filter[$tag]) ) 49 return $ string;49 return $value; 50 50 51 51 reset( $wp_filter[ $tag ] ); 52 52 … … 55 55 do{ 56 56 foreach( (array) current($wp_filter[$tag]) as $the_ ) 57 57 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'])); 60 60 } 61 61 62 62 } while ( next($wp_filter[$tag]) !== false ); 63 63 64 return $ string;64 return $value; 65 65 } 66 66 67 67 /**