Ticket #5267 (closed enhancement: fixed)

Opened 1 year ago

Last modified 10 months ago

Filter bloginfo_rss only passes one argument

Reported by: tzafrir Assigned to: anonymous
Priority: normal Milestone: 2.5
Component: General Version: 2.3
Severity: normal Keywords: has-patch
Cc:

Description

According to The codex the filter bloginfo_rss should pass a second argument, $show, that tells exactly what blog info is called.

However, in feed.php:

function bloginfo_rss($show = '') {
	echo apply_filters('bloginfo_rss', get_bloginfo_rss($show));
}

Only the content argument is passed.

As expected, when trying to use the second argument in the filter function, I receive a warning: Missing argument 2.

I'm aware that one way to solve this is to remove the wrong part from the codex, but I'm hpoing more towards actually having that feature, becuase right now it makes it impossible for me to filter only bloginfo_rss('name'), for example.

Attachments

5267.patch (0.6 kB) - added by Viper007Bond on 11/30/07 00:12:36.
Props tzafrir

Change History

10/28/07 04:28:28 changed by Viper007Bond

Can filters even accept a 2nd argument? I thought that was only actions that could.

10/28/07 07:31:30 changed by tzafrir

They accept a second argument in the same manner as actions,

add_filter('filtername', 'function', priority, argumentcount);

10/28/07 08:28:29 changed by Viper007Bond

Ah, RTFM, huh? Heh.

Wondered why apply_filters('customfiltername', $var1, $var2) never worked for me...

11/27/07 07:54:41 changed by ryan

  • status changed from new to closed.
  • resolution set to invalid.

11/27/07 07:57:29 changed by Viper007Bond

  • milestone deleted.

11/29/07 23:56:29 changed by tzafrir

What does that mean, invalid?

There is still no way to properly use this filter.

11/30/07 00:12:07 changed by tzafrir

  • status changed from closed to reopened.
  • resolution deleted.

apply_filters() isn't passing a 2nd parm, so adding a 2 to add_filter() does nothing.

Reopening by advice of Viper007bond.

11/30/07 00:12:36 changed by Viper007Bond

  • attachment 5267.patch added.

Props tzafrir

11/30/07 00:13:02 changed by Viper007Bond

  • keywords set to has-patch.
  • milestone set to 2.4.

11/30/07 00:14:14 changed by Viper007Bond

  • type changed from defect to enhancement.

12/02/07 05:05:21 changed by ryan

Oops, sorry, misread the thread. Patch looks fine.

02/07/08 18:01:33 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [6750]) Pass 'show' argument to bloginfo_rss filters. Props tzafrir and Viper007Bond. fixes #5267