Automattic\WooCommerce\Internal\Admin\Settings

SettingsUISchema::get_custom_attributesprivate staticWC 1.0

Normalize custom attributes for React controls.

Метод класса: SettingsUISchema{}

Хуков нет.

Возвращает

Массив.

Использование

$result = SettingsUISchema::get_custom_attributes( $custom_attributes ): array;
$custom_attributes(массив) (обязательный)
Raw custom attributes.

Код SettingsUISchema::get_custom_attributes() WC 10.9.1

private static function get_custom_attributes( array $custom_attributes ): array {
	$attributes = array();

	foreach ( $custom_attributes as $attribute => $value ) {
		if ( ! is_scalar( $value ) ) {
			continue;
		}

		$attribute_key = sanitize_key( (string) $attribute );
		if ( '' === $attribute_key ) {
			continue;
		}

		$attributes[ $attribute_key ] = $value;
	}

	return $attributes;
}