| @@ -1,0 +1,18 @@ | ||
| 1 | +<?php | |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 4 | +if (strpos($this->content, 'acym__wysid__template') !== false) { | |
| 5 | + $bodyPos = strpos($this->content, '<body>'); | |
| 6 | + $endBodyPos = strpos($this->content, '</body>'); | |
| 7 | + | |
| 8 | + $emailContent = $this->content; | |
| 9 | + | |
| 10 | + if ($bodyPos !== false && $endBodyPos !== false) { | |
| 11 | + $emailContent = substr(substr($this->content, 0, $endBodyPos), $bodyPos + 6); | |
| 12 | + } | |
| 13 | + | |
| 14 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Raw newsletter content built by the user with the email editor. | |
| 15 | + echo $emailContent; | |
| 16 | +} else { | |
| 17 | + include acym_getPartial('editor', 'default_template'); | |
| 18 | +} | |