WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#4378 closed enhancement (invalid)

Adding filters for Recent Comments Widget

Reported by: hovenko Owned by:
Priority: low Milestone:
Component: Widgets Version: 2.7
Severity: minor Keywords: needs-patch
Cc:

Description

The attached patch adds two filters called "comments_join" and "comments_where" to alter the SQL statement for the Recent Comments widget.

Attachments (1)

widgets.patch (1.5 KB) - added by hovenko 6 years ago.
Adds filters for distinct, join and where to recent comments.

Download all attachments as: .zip

Change History (11)

comment:1 rob1n6 years ago

Maybe it's time for a comments API?

comment:2 hovenko6 years ago

  • Type changed from defect to enhancement

I see that the cache was not cleared when new comments were written. Applying a new patch.

hovenko6 years ago

Adds filters for distinct, join and where to recent comments.

comment:3 Nazgul6 years ago

  • Keywords has-patch added

comment:4 ryan6 years ago

  • Milestone changed from 2.3 to 2.4

comment:5 ffemtcj5 years ago

  • Milestone changed from 2.5 to 2.6

comment:6 mrmist4 years ago

  • Keywords needs-patch added; has-patch removed

Currently the recent comments widget uses a SELECT * which is a change from the version that the attached patch was created against.

Consequently this would have to be re-done, in case limiting the output to just the fields in the patch breaks other functionality.

As an aside, selecting either * or comment_id, comment_post_id would always be DISTINCT so the keyword is not required.

comment:7 mrmist4 years ago

  • Version set to 2.7

comment:8 ryan4 years ago

  • Component changed from General to Widgets
  • Owner anonymous deleted

comment:9 Denis-de-Bernardy4 years ago

  • Priority changed from normal to low
  • Severity changed from normal to minor

see also #9211

comment:10 Denis-de-Bernardy4 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

you can now override the widget's callback entirely.

Note: See TracTickets for help on using tickets.