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:
committed by
Aschepikov
parent
80f22c5b50
commit
f92ee90e9b
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user