Add Preprocessor for removing unwanted blocks

[MAILPOET-5591]
This commit is contained in:
Jan Lysý
2023-10-12 18:30:25 +02:00
committed by Jan Lysý
parent c1768fd0b2
commit fe5eabfe49
9 changed files with 103 additions and 10 deletions

View File

@ -42,7 +42,7 @@ class Renderer {
$parser = new \WP_Block_Parser();
$parsedBlocks = $parser->parse($post->post_content); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
$parsedBlocks = $this->preprocessManager->preprocess($parsedBlocks);
$parsedBlocks = $this->preprocessManager->preprocess($parsedBlocks, $this->stylesController->getEmailLayoutStyles());
$renderedBody = $this->blocksRenderer->render($parsedBlocks);
$styles = (string)file_get_contents(dirname(__FILE__) . '/' . self::TEMPLATE_STYLES_FILE);