Automattic\WooCommerce\Internal\Admin\Settings
SettingsUISchema::normalize_options
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() 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;
}