ProPanel: Remove group leader user role from Filtering user’s dropdown list

/**
 * LD Propanel - Example to filter the Reporting user search 
 * Example 1: This example adds an exclude for 'group_leader' roles
 *
 * @since v2.0.1
 *
 * @param array $user_search_args An array of elements to be passed into WP_User_Query 
 * @return array $user_search_args modified array.
 */
add_filter( 'ld_propanel_reporting_user_search_args', function( $user_search_args = array() ) { 

	// Example 1:
	// For admin users only - We want to exclude 'group_leader' roles from the user search results.
	if ( learndash_is_admin_user() ) {
	
		// Ensure we have the 'role__not_in' array element. And it is an array.
		if ( !array_key_exists('role__not_in', $user_search_args ) ) {
			$user_search_args['role__not_in'] = array();
		}

		// Check the 'group_leader' role is not already present in the element values. 
		if ( !in_array( 'group_leader', $user_search_args['role__not_in'] ) ) {
			$user_search_args['role__not_in'][] = 'group_leader';
		}
	}

	// always return the $user_search_args array
	return $user_search_args;
}, 10, 1 );