#5173 closed enhancement (fixed)
Allowing plugin to style group rows in directory & widget loops and in admin ui
Reported by: | imath | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 1.9 | Priority: | normal |
Severity: | normal | Version: | 1.8.1 |
Component: | Groups | Keywords: | has-patch 2nd-opinion |
Cc: | math.viet@… |
Description
Hi,
This request is relative to #2242 . I've built a plugin to stick groups in the groups directory. So far i'm filtering the bp_get_group_name tag to style the sticky groups. But that's definitely a very bad idea i had. The reason is that bp_get_group_name is used in select box options, in group edit field, and in link titles (i think another non filterable function should be used for these cases, i'll post a suggestion in a next ticket).
So to avoid breaking the html, i've temporarly encapsulated the filters between the 'bp_before_groups_loop' and 'bp_after_groups_loop', but as soon as a theme will for example use title="<?php bp_group_name();?>"
in the link tag, that will break the html :( and will populate the support of the bp-sticky-groups plugin ;)
I've noticed that since 1.7, there was an interesting template tag : bp_group_class()
. But it isn't use by default in bp-legacy or bp-default groups-loop.php templates. I imagine this tag is there to help theme designers to include it in their templates. Well, in the case of bp-sticky-groups, if this tag was used by "default", it would help me a lot !!
So, in the attached diff, i'm suggesting to use it and i also suggest to allow plugins to filter group admin ui row class as it will help in my case to also style the sticky groups in the admin listing.
Looks good to me. Thanks, imath.