#5287 closed enhancement (fixed)
add a column to BP_Groups_List_Table
| Reported by: | shanebp | Owned by: | imath |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.0 |
| Component: | Groups | Version: | |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | shane@… |
Description
It would be very useful to add the ability to add a custom column and fill that column per row in BP_Groups_List_Table.
It would require a do_action_ref_array filter in
function get_columns()
And maybe a filter in
function single_row()
so we can populate that column per row ?
Might have to override function single_row_columns() ?
You get the idea...
Following on would be the ability to integrate custom fields / options in
function bp_groups_admin_edit()
for the single group screen.
Would it be possible to use a template for that screen ?
The recent update of Group_Extension_API was very helpful.
But the ability to integrate data (from extensions or otherwise) in the DashBoard > Groups screens would fill a big gap in arguably the most attractive part of BP - Groups ( at least for my clients ).
Attachments (3)
Change History (12)
#3
@
13 years ago
Thanks @imath
Core devs: would you like me to make a separate ticket re the single group screen ?
#4
@
13 years ago
- Component Core → Groups
- Keywords 2nd-opinion removed
- Milestone Awaiting Review → 2.0
This seems like a reasonable request. Would be nice if there were a more elegant way, but that's WP_List_Table's fault.
shanebp - It's already possible to add meta boxes to single group screens, using the regular meta box API. Look at how BP does it in bp-groups/bp-groups-admin.php.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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 );