Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#6222 closed defect (bug) (fixed)

Audit filters in core widgets to ensure they meet WordPress expectations

Reported by: dcavins's profile dcavins Owned by: dcavins's profile dcavins
Milestone: 2.3 Priority: normal
Severity: minor Version: 2.2
Component: Core Keywords: has-patch commit
Cc:

Description

Bowe pointed out via Slack that he was having trouble applying the filter widget_title to the BP members widget.

The problem is that that widget isn't providing the expected parameters to the filter.

From BP members widget:
$title = apply_filters( 'widget_title', $instance['title'] );

The parameters expected in widget_title are
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );

I'd be happy to complete the audit and write patches if someone will assign it to me.

Attachments (2)

6222.01.patch (6.7 KB) - added by dcavins 10 years ago.
Add arguments to 'widget_title' filter. Add $instance settings and $id_base to the arguments passed along with the ‘widget_title’ filter for BP core widgets.
6222.02.patch (2.9 KB) - added by dcavins 10 years ago.
Verify that title is set before widget_title filter. Use calculated value in filter. Be sure that the title value is set before passing to the filter. See #6222.

Download all attachments as: .zip

Change History (9)

#1 @DJPaul
10 years ago

  • Keywords good-first-bug added

#2 @dcavins
10 years ago

  • Keywords has-patch added; needs-patch removed

I've added the necessary arguments. I think this (simple) patch should be ready to go but would appreciate another set of eyes on my changes.

#3 @boonebgorges
10 years ago

  • Keywords commit added; good-first-bug removed

This looks good, dcavins.

@dcavins
10 years ago

Add arguments to 'widget_title' filter. Add $instance settings and $id_base to the arguments passed along with the ‘widget_title’ filter for BP core widgets.

#4 @dcavins
10 years ago

  • Owner set to dcavins
  • Resolution set to fixed
  • Status changed from new to closed

In 9709:

Add arguments to 'widget_title' filter.

Add $instance settings and $id_base to the arguments passed along with the
'widget_title' filter for BP core widgets.

Fixes #6222.

@dcavins
10 years ago

Verify that title is set before widget_title filter.
Use calculated value in filter. Be sure that the title value is set before passing to the filter. See #6222.

#5 @dcavins
10 years ago

Attached a second patch that reverts three instances of using the raw title attribute rather than a calculated title attribute and makes sure that the value is set in three other cases before sending it out to the filter.

#6 @dcavins
10 years ago

In 9738:

Use calculated title for widget_title filter.

Use the calculated title when one exists in 'widget_title' filter.

See #6222.

#7 @DJPaul
8 years ago

  • Component changed from Component - Any/All to Core
Note: See TracTickets for help on using tickets.