Migrate email editor templates class to WP Coding Standard

[MAILPOET-6240]
This commit is contained in:
Jan Lysý
2024-10-23 15:46:37 +02:00
committed by Jan Lysý
parent a31857ffee
commit f5e54abecf
3 changed files with 180 additions and 82 deletions

View File

@@ -39,8 +39,8 @@ class Renderer {
public function render( \WP_Post $post, string $subject, string $preHeader, string $language, $metaRobots = '' ): array {
$templateId = 'mailpoet/mailpoet//' . ( get_page_template_slug( $post ) ?: 'email-general' );
$template = $this->templates->getBlockTemplate( $templateId );
$theme = $this->templates->getBlockTemplateTheme( $templateId, $template->wp_id ); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
$template = $this->templates->get_block_template( $templateId );
$theme = $this->templates->get_block_template_theme( $templateId, $template->wp_id ); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
// Set the theme for the template. This is merged with base theme.json and core json before rendering.
self::$theme = new WP_Theme_JSON( $theme, 'default' );