[buddypress-trac] [BuddyPress] #3161: groups_get_groups should be able to process custom $type
    buddypress-trac at lists.automattic.com 
    buddypress-trac at lists.automattic.com
       
    Wed Apr 20 16:53:35 UTC 2011
    
    
  
#3161: groups_get_groups should be able to process custom $type
-------------------------+-----------------------------
 Reporter:  calvin_42    |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Groups       |    Version:
 Keywords:               |
-------------------------+-----------------------------
 I would like to add a new sort order for the groups in the groups
 directory page. Thanks to the hook 'bp_groups_directory_order_options'
 (see groups/index.php in default theme), I have added an entry :
 {{{
 /**
  * Add a sort order for the groups
  */
 function bp_custom_groups_directory_order_options() { ?>
         <option value="creative">Filter Label</option>
 <?php
 }
 add_action( 'bp_groups_directory_order_options',
 'bp_custom_groups_directory_order_options' );
 }}}
 The Ajax call made when the user changes the sort input calls successively
 :
 - bp_has_groups() with the $type parameter set to "creative" in my case
 - the constructor bp_groups_template()
 - groups_get_groups()
 Well in this last function the switch use the "default:" operand which
 means BP_Groups_Group::get_active() is called.
 What should be done is a new "default:" instruction which triggers a new
 hook "groups_get_groups_custom_type" with $type and $args for arguments.
 If you're okay with it I can provide a patch.
-- 
Ticket URL: <https://trac.buddypress.org/ticket/3161>
BuddyPress <http://buddypress.org/>
BuddyPress
    
    
More information about the buddypress-trac
mailing list