Browse: Home / Snippets /

Override displayed columns in Groups listing page

Contents


Snippet #

Important: All snippets are provided as-is without support or guarantees. These snippets are provided as guidelines for advanced users looking to customize LearnDash. For any additional help or support with these snippets, we recommend reaching out to a LearnDash Expert.

 * 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 );