Skip to:
Content

BuddyPress.org

Changeset 8051


Ignore:
Timestamp:
03/05/2014 10:11:40 PM (10 years ago)
Author:
imath
Message:

Introduce new filters to add a custom column to BP_Groups_List_Table()

In Group Administration screen, plugins/themes can now use these filters to add a custom column to the groups list table.

Props shanebp

Fixes #5287

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-admin.php

    r8030 r8051  
    12981298     */
    12991299    function get_columns() {
    1300         return array(
     1300        return apply_filters( 'bp_groups_list_table_get_columns', array(
    13011301            'cb'          => '<input name type="checkbox" />',
    13021302            'comment'     => _x( 'Name', 'Groups admin Group Name column header',               'buddypress' ),
     
    13051305            'members'     => _x( '# Members', 'Groups admin Members column header',             'buddypress' ),
    13061306            'last_active' => _x( 'Last Active', 'Groups admin Last Active column header',       'buddypress' )
    1307         );
     1307        ) );
    13081308    }
    13091309
     
    14811481        echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) );
    14821482    }
    1483 }
     1483
     1484    /**
     1485     * Allow plugins to add their costum column.
     1486     *
     1487     * @since BuddyPress 2.0.0
     1488     *
     1489     * @param array Information about the current row.
     1490     * @param string the column name.
     1491     */
     1492    function column_default( $item = array(), $column_name = '' ) {
     1493        return apply_filters( 'bp_groups_admin_get_group_custom_column', '', $column_name, $item );
     1494    }
     1495}
Note: See TracChangeset for help on using the changeset viewer.