bp_rest_sanitize_string_list( array|string $list )

Clean up an array, comma- or space-separated list of strings.

Description

Parameters

$list

(Required) List of strings.

Return

(array) Sanitized array of strings.

Source

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

function bp_rest_sanitize_string_list( $list ) {
	if ( ! is_array( $list ) ) {
		$list = preg_split( '/[\s,]+/', $list );
	}

	return array_unique( array_map( 'sanitize_text_field', $list ) );
}

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.