WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#10573 closed enhancement (fixed)

Pass $instance to the "widget_text" filter

Reported by: Viper007Bond Owned by: azaozz
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

I'm trying to conditionally change the content of the text widget. I'm storing whether I need to modify the content or not in the widget's settings by using the widget_update_callback filter and adding a key to the array. However I cannot access the reset of the widget's settings (where my new key is) from within the widget_text filter.

Attached patch passes $instance to the widget_title and widget_text filters for increased flexibility.

Attachments (1)

10573.patch (833 bytes) - added by Viper007Bond 5 years ago.

Download all attachments as: .zip

Change History (4)

Viper007Bond5 years ago

comment:1 Viper007Bond5 years ago

  • Type changed from defect (bug) to enhancement

comment:2 Viper007Bond5 years ago

  • Milestone changed from Unassigned to 2.9
  • Version set to 2.9

comment:3 westi5 years ago

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

(In [11792]) Pass the widget instance as context to the widget_title and widget_text filters. Fixes #10573 props Viper007Bond.

Note: See TracTickets for help on using tickets.