Automattic\WooCommerce\EmailEditor\Integrations\Utils
Html_Processing_Helper::is_wrapper_handled_class
Whether a single class name applies a background or border that the wrapping table cell already renders.
Метод класса: Html_Processing_Helper{}
Хуков нет.
Возвращает
bool. True when the class should not stay on the inner element.
Использование
$result = Html_Processing_Helper::is_wrapper_handled_class( $class_name ): bool;
- $class_name(строка) (обязательный)
- Class name to test.
Код Html_Processing_Helper::is_wrapper_handled_class() Html Processing Helper::is wrapper handled class WC 11.2.2
private static function is_wrapper_handled_class( string $class_name ): bool {
// `has-background` is added for any background. Preset palette backgrounds add
// `has-<slug>-background-color` on top of it, which is why matching the bare name is not enough.
if ( 'has-background' === $class_name ) {
return true;
}
if ( str_starts_with( $class_name, 'has-' ) && str_ends_with( $class_name, '-background-color' ) ) {
return true;
}
// Border classes, e.g. `has-border-color`, `has-<slug>-border-color`.
return false !== strpos( $class_name, '-border-' );
}