shortcut to the first argument if (!isset($shortcodeDetails['argument'])) { $shortcodeDetails['argument'] = $attrName; $shortcodeDetails['argument_value'] = $attrValue; } } return $shortcodeDetails; } public function process($shortcodes, $content = '') { $processedShortcodes = []; foreach ($shortcodes as $shortcode) { $shortcodeDetails = $this->match($shortcode); if (empty($shortcodeDetails)) { // Wrong MailPoet shortcode syntax, try to parse as a native WP shortcode $shortcodeDetails = $this->matchWPShortcode($shortcode); } $shortcodeDetails['shortcode'] = $shortcode; $shortcodeDetails['category'] = !empty($shortcodeDetails['category']) ? $shortcodeDetails['category'] : ''; $shortcodeDetails['action'] = !empty($shortcodeDetails['action']) ? $shortcodeDetails['action'] : ''; $shortcodeDetails['action_argument'] = !empty($shortcodeDetails['argument']) ? $shortcodeDetails['argument'] : ''; $shortcodeDetails['action_argument_value'] = !empty($shortcodeDetails['argument_value']) ? $shortcodeDetails['argument_value'] : ''; $shortcodeDetails['arguments'] = !empty($shortcodeDetails['arguments']) ? $shortcodeDetails['arguments'] : []; $category = strtolower($shortcodeDetails['category']); $categoryClass = $this->getCategoryObject($category); if ($categoryClass instanceof CategoryInterface) { $processedShortcodes[] = $categoryClass->process( $shortcodeDetails, $this->newsletter, $this->subscriber, $this->queue, $content, $this->wpUserPreview ); } else { $customShortcode = $this->wp->applyFilters( 'mailpoet_newsletter_shortcode', $shortcode, $this->newsletter, $this->subscriber, $this->queue, $content, $shortcodeDetails['arguments'], $this->wpUserPreview ); $processedShortcodes[] = ($customShortcode === $shortcode) ? false : $customShortcode; } } return $processedShortcodes; } public function replace($content, $contentSource = null, $categories = null) { $shortcodes = $this->extract($content, $categories); if (!$shortcodes) { return $content; } // if content contains only shortcodes (e.g., [newsletter:post_title]) but their processing // depends on some other content (e.g., "post_id" inside a rendered newsletter), // then we should use that content source when processing shortcodes $processedShortcodes = $this->process( $shortcodes, ($contentSource) ? $contentSource : $content ); return str_replace($shortcodes, $processedShortcodes, $content); } private function getCategoryObject($category): ?CategoryInterface { if ($category === 'link') { return $this->linkCategory; } elseif ($category === 'date') { return $this->dateCategory; } elseif ($category === 'newsletter') { return $this->newsletterCategory; } elseif ($category === 'subscriber') { return $this->subscriberCategory; } elseif ($category === 'site') { return $this->siteCategory; } return null; } }
Fatal error: Uncaught Error: Class "MailPoet\Newsletter\Shortcodes\Shortcodes" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:3557 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4958): MailPoetGenerated\FreeCachedContainer->getShortcodes2Service() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4928): MailPoetGenerated\FreeCachedContainer->getRenderer6Service() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2276): MailPoetGenerated\FreeCachedContainer->getTransactionalEmailHooksService() #3 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #4 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #5 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #6 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #7 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(206): require_once('/htdocs/wp-cont...') #8 /htdocs/wp-settings.php(462): include_once('/htdocs/wp-cont...') #9 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #10 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #11 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #12 /htdocs/index.php(17): require('/htdocs/wp-blog...') #13 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 3557