Automattic\WooCommerce\Internal\Admin\Settings

SettingsUISchema::normalize_options │ private static │ WC 1.0

Normalize an option map.

Method of the class: SettingsUISchema{}

No Hooks.

Returns

array.

Usage

$result = SettingsUISchema::normalize_options( $raw_options ): array;
$raw_options(array) (required)
Raw option map.

SettingsUISchema::normalize_options() code WC 11.2.1

private static function normalize_options( array $raw_options ): array {
	$options = array();
	foreach ( $raw_options as $value => $label ) {
		if ( ! is_scalar( $label ) && null !== $label ) {
			continue;
		}

		$options[] = array(
			'label' => is_scalar( $label ) ? wp_strip_all_tags( html_entity_decode( (string) $label, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 ) ) : '',
			'value' => (string) $value,
		);
	}

	return $options;
}