bp_member_type_exclude_users_from_directory_and_searches( bool $qs = false, bool $object = false )

Exclude specific profile types from search and listing.

Description

Parameters

$qs

(bool) (Optional)

Default value: false

$object

(bool) (Optional)

Default value: false

Return

(bool|string)

Source

File: bp-core/deprecated/buddyboss/1.2.9.php

function bp_member_type_exclude_users_from_directory_and_searches( $qs=false, $object=false ) {

	$exclude_user_ids = bp_get_users_of_removed_member_types();
	//print_r($exclude_user_ids);

	if( $object != 'members' )
		return $qs;

	$args = wp_parse_args( $qs );

	// Removed this condition to add the profile type filter works properly do not remove because need to check if this causing anywhere.
	//if( ! empty( $args['user_id'] ) )
		//return $qs;

	if( ! empty( $args['exclude'] ) )
		$args['exclude'] = $args['exclude'] . ',' . implode( ',', $exclude_user_ids );
	else
		$args['exclude'] = implode( ',', $exclude_user_ids );

	$qs = build_query( $args );

	return $qs;
}

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.