Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks
Table::is_valid_table_content
Validate if the content is a valid table HTML.
Method of the class: Table{}
No Hooks.
Returns
true|false. True if it's a valid table, false otherwise.
Usage
// private - for code of main (parent) class only $result = $this->is_valid_table_content( $content ): bool;
- $content(string) (required)
- The content to validate.
Table::is_valid_table_content() Table::is valid table content code WC 10.4.3
private function is_valid_table_content( string $content ): bool {
// Only assert that a <table> exists; downstream checks handle emptiness and KSES handles sanitization.
return (bool) preg_match( '/<table[^>]*>.*?<\/table>/is', $content );
}