bp_group_type_sort_items( type $qv )

Sort list of group type post types.

Description

Parameters

$qv

(type) (Required)

Return

(string)

Source

File: bp-groups/bp-groups-admin.php

function bp_group_type_sort_items( $qv ) {

	if( ! isset( $qv['post_type'] ) || $qv['post_type'] != bp_get_group_type_post_type() )
		return $qv;

	if( ! isset( $qv['orderby'] ) )
		return $qv;

	switch( $qv['orderby'] ) {

		case 'group_type':

			$qv['meta_key'] = '_bp_group_type_name';
			$qv['orderby'] = 'meta_value';

			break;

		case 'enable_filter':

			$qv['meta_key'] = '_bp_group_type_enable_filter';
			$qv['orderby'] = 'meta_value_num';

			break;

	}

	return $qv;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.