Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks
Table::is_striped_table
Check if the table has striped styling.
Method of the class: Table{}
No Hooks.
Returns
true|false. True if it's a striped table, false otherwise.
Usage
// private - for code of main (parent) class only $result = $this->is_striped_table( $block_content, $parsed_block ): bool;
- $block_content(string) (required)
- Block content.
- $parsed_block(array) (required)
- Parsed block.
Table::is_striped_table() Table::is striped table code WC 10.5.0
private function is_striped_table( string $block_content, array $parsed_block ): bool {
// Check for is-style-stripes in block attributes.
if ( isset( $parsed_block['attrs']['className'] ) && false !== strpos( $parsed_block['attrs']['className'], 'is-style-stripes' ) ) {
return true;
}
// Check for is-style-stripes in figure classes.
if ( false !== strpos( $block_content, 'is-style-stripes' ) ) {
return true;
}
return false;
}