Ticket #11891 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Make Recent Comments dashboard module configurable

Reported by: janeforshort Owned by: azaozz
Priority: normal Milestone: 3.0
Component: Widgets Version: 2.9.1
Severity: normal Keywords: has-patch
Cc:

Description

In 2.7, we didn't get around to this due to time, and we planned to make this dashboard widget configurable in 2.8 (then forgot). The widget should be configurable to at least let user decide how many comments to display in the widget. This ticket is only requesting that single configuration option. However, if someone wanted to get super industrious and write a patch that upgraded the Recent Comments dashboard widget to pull in the 'river of comments' instead of only displaying 5 (which winds up empty if you delete or spam those 5), that would be even more awesome. :)

Leaving in 3.0 for now in case someone steps up before freeze, but will punt if no patch in time.

Attachments

11891.diff Download (3.2 KB) - added by nacin 2 years ago.
Adds configuration option

Change History

nacin2 years ago

Adds configuration option

  • Keywords has-patch added
  • Owner set to azaozz
  • Component changed from Administration to Widgets

Taking the less industrious route, patch attached that adds a single configuration option for how many comments to display in the widget. In the patch the count is restricted to <= 10.

comment:2 follow-ups: ↓ 3 ↓ 6   archon8102 years ago

I think I'll piggyback this long overdue issue into this ticket while we're on the Recent Comments topic.

The Recent Comments core code actually adds an inline non-configurable css:

<style type="text/css">.recentcomments a{display:inline !important;
padding:0 !important;margin:0 !important;}</style>

This is done in default-widgets.php.

I think it's really bad practice because

  • it's not configurable
  • it's not removable or overridable due to !important - when I tried to remove the filter, I found that it had a non-unique changing name WP_Widget_Recent_Commentsrecent_comments_style25

Somebody even created a blog post about this issue  here but the solution didn't work for me due to, most likely, changes in later versions of WP.

Specifically, in my case, I need to override the padding property.

Thoughts?

Thanks.

comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4   nacin2 years ago

Replying to archon810:

I think I'll piggyback this long overdue issue into this ticket while we're on the Recent Comments topic.

We're talking about a dashboard widget. But even if we were talking about the same widget, you shouldn't hijack tickets like this.

comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5   archon8102 years ago

Replying to nacin:

Replying to archon810:

I think I'll piggyback this long overdue issue into this ticket while we're on the Recent Comments topic.

We're talking about a dashboard widget. But even if we were talking about the same widget, you shouldn't hijack tickets like this.

I'm sorry - I confused it with the Appearance sidebar widget and didn't mean it as a hijack but rather a quick mod to the patch included here. I should read better next time. I'll file a separate ticket for my issue.

comment:5 in reply to: ↑ 4   nacin2 years ago

Replying to archon810:

I should read better next time.

:) We've all done that before, don't worry.

I'll file a separate ticket for my issue.

Just a heads up, this method of injecting CSS is done in a few places, I imagine for a few widgets plus the gallery code as well.

comment:6 in reply to: ↑ 2   archon8102 years ago

Opened [11928] for my issue. Sorry for the interruptions, carry on now :-]

(In [13084]) Make Recent Comments dashboard widget configurable. Allows user to choose how many comments to display, see #11891.

comment:8   jane2 years ago

I'm good with 3.0 doing the less industrious route, but would would psyched if it wasn't limited to <=10. Could we do 5, 10, 15, 20, 25, 30? Yes, that would be a long module, but for people who delete a lot of comments/pings it would make the Recents Comments module a little more useful until a future version when we could bring in the river of comments.

I committed it with 15 as the limit, the same as the public Recent Comments widget. Would have no problem upping to any number you decree :)

I think the river would be good for 3.1. If I have time next week to look into it and I've emptied my queue, I'll take a look again for 3.0 though.

(In [13373]) Add missing </small> tag. see #11891 fixes #12321 props ocean90

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

(In [13519]) Boost number of comments allowed in configurable Recent Comments dashboard module. fixes #11891

Note: See TracTickets for help on using tickets.