Add support for [site:title] and [site:homepage_link]

These will add support for these two shortcodes in the Shortcode engine

MAILPOET-4599
This commit is contained in:
Oluwaseun Olorunsola
2022-10-19 13:29:24 +01:00
committed by Aschepikov
parent 80f22c5b50
commit f92ee90e9b
5 changed files with 59 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ use MailPoet\Newsletter\Shortcodes\Categories\CategoryInterface;
use MailPoet\Newsletter\Shortcodes\Categories\Date;
use MailPoet\Newsletter\Shortcodes\Categories\Link;
use MailPoet\Newsletter\Shortcodes\Categories\Newsletter;
use MailPoet\Newsletter\Shortcodes\Categories\Site;
use MailPoet\Newsletter\Shortcodes\Categories\Subscriber;
use MailPoet\WP\Functions as WPFunctions;
@@ -37,6 +38,9 @@ class Shortcodes {
/** @var Subscriber */
private $subscriberCategory;
/** @var Site */
private $siteCategory;
/** @var WPFunctions */
private $wp;
@@ -45,12 +49,14 @@ class Shortcodes {
Link $linkCategory,
Newsletter $newsletterCategory,
Subscriber $subscriberCategory,
Site $siteCategory,
WPFunctions $wp
) {
$this->dateCategory = $dateCategory;
$this->linkCategory = $linkCategory;
$this->newsletterCategory = $newsletterCategory;
$this->subscriberCategory = $subscriberCategory;
$this->siteCategory = $siteCategory;
$this->wp = $wp;
}
@@ -210,6 +216,8 @@ class Shortcodes {
return $this->newsletterCategory;
} elseif ($category === 'subscriber') {
return $this->subscriberCategory;
} elseif ($category === 'site') {
return $this->siteCategory;
}
return null;
}