WC_REST_Settings_V2_Controller::filter_group()publicWC 3.0.0

Filters out bad values from the groups array/filter so we only return known values via the API.

Method of the class: WC_REST_Settings_V2_Controller{}

No Hooks.

Return

Array.

Usage

$WC_REST_Settings_V2_Controller = new WC_REST_Settings_V2_Controller();
$WC_REST_Settings_V2_Controller->filter_group( $group );
$group(array) (required)
Group.

Changelog

Since 3.0.0 Introduced.

WC_REST_Settings_V2_Controller::filter_group() code WC 9.0.1

public function filter_group( $group ) {
	return array_intersect_key(
		$group,
		array_flip( array_filter( array_keys( $group ), array( $this, 'allowed_group_keys' ) ) )
	);
}