Make WordPress Core

Opened 17 years ago

Closed 16 years ago

#5267 closed enhancement (fixed)

Filter bloginfo_rss only passes one argument

Reported by: tzafrir's profile tzafrir Owned by:
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.3
Component: General Keywords: has-patch
Focuses: 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 (1)

5267.patch (653 bytes) - added by Viper007Bond 16 years ago.
Props tzafrir

Download all attachments as: .zip

Change History (12)

#1 @Viper007Bond
17 years ago

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

#2 @tzafrir
17 years ago

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

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

#3 @Viper007Bond
17 years ago

Ah, RTFM, huh? Heh.

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

#4 @ryan
16 years ago

  • Resolution set to invalid
  • Status changed from new to closed

#5 @Viper007Bond
16 years ago

  • Milestone 2.3.2 deleted

#6 @tzafrir
16 years ago

What does that mean, invalid?

There is still no way to properly use this filter.

#7 @tzafrir
16 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

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

Reopening by advice of Viper007bond.

@Viper007Bond
16 years ago

Props tzafrir

#8 @Viper007Bond
16 years ago

  • Keywords has-patch added
  • Milestone set to 2.4

#9 @Viper007Bond
16 years ago

  • Type changed from defect to enhancement

#10 @ryan
16 years ago

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

#11 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

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

Note: See TracTickets for help on using tickets.