[buddypress-trac] [BuddyPress] #2242: make Group sticky
buddypress-trac
noreply at wordpress.org
Sat Sep 7 14:13:35 UTC 2013
#2242: make Group sticky
-------------------------------------------------+-------------------------
Reporter: erich73 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future
Component: Groups | Release
Severity: normal | Version:
Keywords: has-patch needs-testing 2nd-opinion | Resolution:
-------------------------------------------------+-------------------------
Comment (by imath):
Replying to [comment:6 boonebgorges]:
> 1) imath - are the hooks and filters in place to make a plugin that does
this?
Well i think as the main challenge of this patch is group pagination and
first excluding sticky to then put them on top, what can be useful for a
plugin is to easily have the arguments of BP_Groups_Group::get()
so in 'bp_groups_get_paged_groups_sql' filter at line 444 of bp-group-
classes.php, i would add them after the $sql argument
eg:
{{{apply_filters( 'bp_groups_get_paged_groups_sql', join( ' ', (array)
$sql ), $sql, $r );}}}
then, after a quick look, by filtering 'bp_has_groups' its possible to
merge $groups_template with sticky groups (if put in a buddypress()
instance var or a global) if on first page as this filter includes the
arguments of bp_has_groups() function (in bp-groups-template.php).
But it could be convenient to merge this data before by adding a filter at
line 516 of bp-groups-classes.php
eg:
{{{return apply_filters( 'bp_groups_return_paged_groups', array( 'groups'
=> $paged_groups, 'total' => $total_groups ), $r );}}}
finally, to include a specific style to a sticky group, i guess it needs a
specific template tag reason why the patch has included one
(bp_groups_group_class())
I understand you're skeptical about the utility to add this in core, i
have doubts too. I've made a quick search and found no plugin doing so, at
the same time i've heard people requesting this feature at several
occasions.. (same for members actually)
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/2242#comment:7>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list