#26495 closed defect (bug) (fixed)
Dashboard "At a Glance" hooks changed
Reported by: | nacin | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.8 | Priority: | high |
Severity: | blocker | Version: | 3.8 |
Component: | Administration | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
+do_action( 'rightnow_list_end' ); +do_action( 'rightnow_list_start' ); -do_action('right_now_content_table_end'); -do_action('right_now_discussion_table_end'); -do_action('right_now_table_end');
We should *never* have had hooks inside a table like that. We could still support these if we wanted. Currently running a search to see if anyone used these.
The new hooks are a bit weird. We should have *one* hook at the bottom, and it should be a filter that implodes into list items, so plugin authors aren't subject to the whims of our markup.
Attachments (2)
Change History (18)
#2
@
11 years ago
In 26495.diff, "Include addition elements" looks like a typo. Should it be "additional"?
#4
@
11 years ago
a) Any benefit in making the filter cover all of the glance items, not just the optional extra ones, so there is more flexibility to remove built-in lines?
b) Could line 224 or 225 get an (array)
cast so that if a string is returned from the final filter, it will still try to output correctly?
#5
@
11 years ago
- Severity changed from normal to blocker
a) Yeah, but it's a bit too late for refactoring the function and figuring out under what parameters will we allow core to be manipulated. This filter is flexible enough that we could just start passing the core ones in 3.9 and all will be fine.
b) It could, but we usually wouldn't here, for two reasons. One, the return value here isn't critical. If a plugin screws up this filter, that's not a big deal. Two, it's better to not suppress developer errors when you can get away with it. Here, the worst that happens is a warning, versus a fatal. It's best to let the developer be told they're doing something wrong.
Setting this ticket to blocker as the current (new) hooks are untenable when it comes to forwards compatibility.
#7
follow-up:
↓ 8
@
11 years ago
Any thoughts on the hook name? dashboard_glance_items is the best I could come up with.
#8
in reply to:
↑ 7
@
11 years ago
Replying to nacin:
Any thoughts on the hook name? dashboard_glance_items is the best I could come up with.
Where it is, what's it for, and what it handles - dashboard_glance_items
seems fine to me.
#11
@
11 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In 26832:
#12
follow-ups:
↓ 13
↓ 15
@
11 years ago
Appreciate the desire to make it easy to add new elements, but the new filter prevents plugins from adding new headings (and therefore sections) to the At a Glance widget. (I realize that I can still hack out of it with an empty list item but that's gross.)
I'm the author of one of the plugins that was using the old hooks. I had updated for 3.8 compatibility prior to RC2, but found it broken yesterday and tracked down the issue to this change.
The primary list of stuff in "At a Glance" is really just post type counts, so it doesn't make sense to tack on additional random other numbers without some type or organizing or ordering.
If the rightnow_end
action preceded the version and privacy setting information, I could hook to that, but it would be weird to stick a list of Post Statuses on after that information rather than immediately after the post counts.
It suspect it's took late to do much about this issue, but I wanted to at least mention this.
#13
in reply to:
↑ 12
;
follow-up:
↓ 14
@
11 years ago
Replying to mrwweb:
One other issue with current filter is that it doesn't put a class on the list items so all new elements get the default circle dashicon.
#14
in reply to:
↑ 13
@
11 years ago
Replying to mrwweb:
One other issue with current filter is that it doesn't put a class on the list items so all new elements get the default circle dashicon.
Looks really odd. It was much easier before to add custom classes to the new markup.
Is this the correct way? We have to insert a dead empty list item now to get proper CSS classes? Wouldn’t it be better to allow two entries per item: one for the text content, one for additional attributes?
I don't really care about compatibility about the old hooks. Having information in the Right Now widget was merely a value-add. And, the widget completely changed. "At a Glance" is a pretty solid instruction for what plugin authors should be putting in this box.