Browse: Home / Snippets /

Override displayed columns in Groups listing page

Contents


Snippet #

 * LearnDash - Filter to override default Group Listing columns shown. 
 * When listing the Group three columns are added:
 *	groups_group_leaders - Group Leaders
 * 	groups_group_courses - Group Courses
 *	groups_group_users - Group Users
 *
 * Sometimes the site has too much data and causes the listing to abort. 
 * So this filter is an example of how to remove the columns from the tables. 
 */
add_filter( 'manage_groups_posts_columns', function( $columns = array() ) {

	// Uncomment the section below to remove the Group Course Leaders column.
	// if ( isset( $columns['groups_group_leaders'] ) ) {
	//	unset( $columns['groups_group_leaders'] );
	// }
	
	// Uncomment the section below to remove the Group Courses column.
	// if ( isset( $columns['groups_group_courses'] ) ) {
	//	unset( $columns['groups_group_courses'] );
	// }


	// Uncomment the section below to remove the Group Course Users column.
	//if ( isset( $columns['groups_group_users'] ) ) {
	//	unset( $columns['groups_group_users'] );
	//}
		
	// Always return $columns;
	return $columns;	
}, 999, 1 );