bp_rest_sanitize_group_types( string $value )

Clean up group_type input.


Parameters Parameters

$value

(string) (Required) Comma-separated list of group types.


Top ↑

Return Return

(array|null)


Source 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;
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.