Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks

Table::get_custom_border_styleprivateWC 1.0

Get custom border style from block attributes.

Method of the class: Table{}

No Hooks.

Returns

String. Custom border style or 'solid' as default.

Usage

// private - for code of main (parent) class only
$result = $this->get_custom_border_style( $parsed_block ): string;
$parsed_block(array) (required)
Parsed block.

Table::get_custom_border_style() code WC 10.5.0

private function get_custom_border_style( array $parsed_block ): string {
	$style   = strtolower( (string) ( $parsed_block['attrs']['style']['border']['style'] ?? '' ) );
	$allowed = array( 'solid', 'dashed', 'dotted' ); // Email-safe subset.
	return in_array( $style, $allowed, true ) ? $style : 'solid';
}