[buddypress-trac] [BuddyPress] #5287: add a column to BP_Groups_List_Table

buddypress-trac noreply at wordpress.org
Wed Dec 11 09:22:44 UTC 2013


#5287: add a column to BP_Groups_List_Table
-----------------------------------+------------------------------
 Reporter:  shanebp                |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Core                   |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+------------------------------
Changes (by imath):

 * keywords:   => has-patch 2nd-opinion


Comment:

 Hi @shanebp, i will reply on the first part of your request.

 To allow plugins adding a custom column to the Administration Groups List
 table, i suggest 5287.diff. I've also added a screencap (custom-
 column.png) of the result of these two example filters plugins can use :

 {{{
 // Name for the column
 function shanebp_add_column( $columns = array() ) {
         $columns['shanebp_custom'] = 'Group ID';
         return $columns;
 }

 add_filter( 'bp_groups_list_table_get_columns', 'shanebp_add_column', 10,
 1 );

 //Content for each group
 function shanebp_fill_group_row( $data = '', $column_name = '', $item =
 array() ) {
         $group_id = $item['id'];

         if( 'shanebp_custom' == $column_name )
                 $data = $group_id;

         return $data;
 }

 add_filter( 'bp_groups_admin_get_group_custom_column',
 'shanebp_fill_group_row', 10, 3 );
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5287#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list