Automattic\WooCommerce\Blocks\BlockTypes
CouponCode::wrap_for_email
Wrap coupon HTML in an email-compatible table structure.
Метод класса: CouponCode{}
Хуков нет.
Возвращает
Строку.
Использование
// private - только в коде основоного (родительского) класса $result = $this->wrap_for_email( $coupon_html, $parsed_block ): string;
- $coupon_html(строка) (обязательный)
- Coupon HTML content.
- $parsed_block(массив) (обязательный)
- Parsed block data.
Код CouponCode::wrap_for_email() CouponCode::wrap for email WC 11.0.1
private function wrap_for_email( string $coupon_html, array $parsed_block ): string {
$align = $this->get_alignment( $parsed_block );
$table_attrs = array(
'style' => \WP_Style_Engine::compile_css(
array(
'border-collapse' => 'collapse',
'width' => '100%',
),
''
),
'width' => '100%',
);
$cell_attrs = array(
'class' => 'email-coupon-code-cell',
'style' => \WP_Style_Engine::compile_css(
array(
'padding' => '10px 0',
'text-align' => $align,
),
''
),
'align' => $align,
);
return Table_Wrapper_Helper::render_table_wrapper( $coupon_html, $table_attrs, $cell_attrs );
}