Opened 19 months ago
Last modified 10 days ago
#19239 new feature request
Combine WordPress News and Other WordPress News dashboard widgets
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Administration | Version: | 3.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | eric@…, sabreuse, bpetty |
Description
We could lighten the dashboard by making this one widget with configuration instead of two separate ones. Anything from WordPress.org official blog would get a highlight to designate it as such. Configure would allow to choose display of both feeds or jus one, and how many items to show.
Attachments (2)
Change History (14)
- Keywords has-patch added; needs-patch removed
Took some time to polish off an initial patch.
This version combines both feeds into a single widget. The official blog feed (2 items with summary) come first, followed by Planet WordPress' feed (5 items, no summary). The official feed is also highlighted with a blue WP logo icon (using an already-defined WP icon).
CSS was revised to include the HiDPI version as well.
Here is a screenshot of the widget in action on the dashboard:
Current version includes no additional options (similar to the Right Now and Plugins dashboard widgets), but it can still be hidden from the dashboard entirely.
comment:3
SergeyBiryukov — 5 months ago
- Milestone changed from Future Release to 3.6
comment:4
follow-up:
↓ 5
SergeyBiryukov — 4 months ago
Current widgets allow to change the RSS feed URL and title, for example to replace the English feed with a localized one.
I guess the new widget should support that as well. Also, from the description:
Configure would allow to choose display of both feeds or just one, and how many items to show.
comment:5
in reply to:
↑ 4
DrewAPicture — 4 months ago
Replying to SergeyBiryukov:
Current widgets allow to change the RSS feed URL and title, for example to replace the English feed with a localized one.
I guess the new widget should support that as well. Also, from the description:
Configure would allow to choose display of both feeds or just one, and how many items to show.
Looking at how the configuration options are currently done, it appears that all four built-in RSS widgets (three Dashboard widgets and a sidebar widget) use the same form which is generated by wp_widget_rss_form().
In my reading of the existing setup, we'd need to add a couple of additional arguments to the array passed via wp_dashboard_newsfeed_control() to wp_dashboard_rss_control() as well as $_POST handlers for that data. wp_widget_rss_form() would need corresponding key/value pairs too. Then there'd need to be a check based on the $widget_id to activate the secondary title and URL fields.
That's if we stick with modifying the existing rss control, CMIIW.
+1 for making a new dashboard widget for this, rather than modifying the existing one. Modification could break a whole heap of plugins that use it.
- Cc bpetty added
Replying to rmccue:
+1 for making a new dashboard widget for this, rather than modifying the existing one. Modification could break a whole heap of plugins that use it.
That's assuming the modifications were done in a backwards incompatible way, and the changes Drew described don't actually sound like they break compatibility (even if they do sound a little unorthodox).
If the current RSS widget methods aren't currently flexible enough to implement this widget, it makes sense to me to refactor and expand their functionality so they can also be used with more 3rd party widgets using an approach similar to this one. What doesn't make sense is writing up a second set of methods that provide the same functionality that have to be maintained right alongside the original methods.
Or as a last result, write a new API and implement the original methods on top of that API (and deprecate them).
The way things originally worked:
- There was one RSS widget function that took some generic parameters (url, show_author, show_summary, show_date, limit) and returned a cachable result with some default markup.
- The functions that registered both original "official" feed widgets merely called this same function but passed different parameters - the official blog shows excerpts, the WordPress Planet feed doesn't
Since you can still add generic RSS feeds, I took the approach of combining these two widgets into a non-generic feed widget, specific to the feeds generated by WordPress.org.
Replying to SergeyBiryukov:
Current widgets allow to change the RSS feed URL and title, for example to replace the English feed with a localized one.
So far as I knew at the time (and please correct me if I'm wrong) there isn't a multi-language setup for either http://wordpress.org/news or http://planet.wordpress.org. I was taking the approach that other language feeds could be added either through the generic RSS widget or by adding a language-specific RSS widget.
Replying to bpetty:
If the current RSS widget methods aren't currently flexible enough to implement this widget, it makes sense to me to refactor and expand their functionality so they can also be used with more 3rd party widgets using an approach similar to this one. What doesn't make sense is writing up a second set of methods that provide the same functionality that have to be maintained right alongside the original methods.
I modeled this widget not after the generic RSS widgets - those are intended specifically to pull/cache a single feed and display its items on the screen. Instead, I modeled it after the plugins widget that grabs two separate feeds and displays both on the screen.
The use-case here is specific enough (i.e. more than one feed, displayed differently) that abstracting the standard RSS widget functionality (which is used elsewhere) didn't make sense. Including functionality to highlight the official blog (adding the WP logo) wouldn't work in a more generic method, either.
Also note that the plugins widget doesn't include configuration options either. So if we are going to add configuration settings to this widget, my push back would be: why? Are we adding settings for the sake of adding settings? Remember, decisions, not options.
comment:10
in reply to:
↑ 9
SergeyBiryukov — 4 months ago
Replying to ericmann:
So far as I knew at the time (and please correct me if I'm wrong) there isn't a multi-language setup for either http://wordpress.org/news or http://planet.wordpress.org.
Right. I meant localized sites like http://pt.wordpress.org/ or http://planet.wpde.org/, which provide relevant news in their language.
I was taking the approach that other language feeds could be added either through the generic RSS widget or by adding a language-specific RSS widget.
I see, makes sense.
comment:11
aaronholbrook — 4 months ago
Testing patch 19239.patch - not sure if it's just my installation, but the widget sits at 'Loading...'.
comment:12
bpetty — 10 days ago
- Milestone changed from 3.6 to Future Release


Would be a good addition to 3.6.