From 387124c66c74a0b52e510dd6d1d2071fe60a9396 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@4179 602fd350-edb4-49c9-b593-d223f7449a82 --- 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); }