bp_rest_sanitize_group_types( string $value )

Clean up group_type input.

Description

Parameters

$value

(Required) Comma-separated list of group types.

Return

(array|null)

Source

File: bp-core/bp-core-rest-api.php

function bp_rest_sanitize_group_types( $value ) {
	if ( empty( $value ) ) {
		return null;
	}

	$types       = explode( ',', $value );
	$valid_types = array_intersect( $types, bp_groups_get_group_types() );

	return empty( $valid_types ) ? null : $valid_types;
}

Changelog

Changelog
Version Description
BuddyBoss 1.3.5 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.