From 3964d277ce317d5e2cd3626517998b09b18b515d Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 10 Sep 2006 17:16:20 +0000 Subject: [PATCH] Pass along the modified string instead of the original. fixes #3118 git-svn-id: http://svn.automattic.com/wordpress/trunk@4179 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/plugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index 462a3a14e7..1fe2c802a5 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -26,7 +26,7 @@ function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) function apply_filters($tag, $string) { global $wp_filter; - $args = array($string); + $args = array(); for ( $a = 2; $a < func_num_args(); $a++ ) $args[] = func_get_arg($a); @@ -42,12 +42,12 @@ function apply_filters($tag, $string) { $function_name = $function['function']; $accepted_args = $function['accepted_args']; + $the_args = $args; + array_unshift($the_args, $string); if ( $accepted_args > 0 ) - $the_args = array_slice($args, 0, $accepted_args); + $the_args = array_slice($the_args, 0, $accepted_args); elseif ( $accepted_args == 0 ) $the_args = NULL; - else - $the_args = $args; $string = call_user_func_array($function_name, $the_args); }