Replace all WP function calls
This commit is contained in:
committed by
M. Shull
parent
986482e34b
commit
0a436087e1
@@ -18,18 +18,18 @@ class Shortcodes {
|
||||
|
||||
function init() {
|
||||
// form widget shortcode
|
||||
add_shortcode('mailpoet_form', array($this, 'formWidget'));
|
||||
WPFunctions::get()->addShortcode('mailpoet_form', array($this, 'formWidget'));
|
||||
|
||||
// subscribers count shortcode
|
||||
add_shortcode('mailpoet_subscribers_count', array(
|
||||
WPFunctions::get()->addShortcode('mailpoet_subscribers_count', array(
|
||||
$this, 'getSubscribersCount'
|
||||
));
|
||||
add_shortcode('wysija_subscribers_count', array(
|
||||
WPFunctions::get()->addShortcode('wysija_subscribers_count', array(
|
||||
$this, 'getSubscribersCount'
|
||||
));
|
||||
|
||||
// archives page
|
||||
add_shortcode('mailpoet_archive', array(
|
||||
WPFunctions::get()->addShortcode('mailpoet_archive', array(
|
||||
$this, 'getArchive'
|
||||
));
|
||||
|
||||
@@ -47,7 +47,7 @@ class Shortcodes {
|
||||
|
||||
function formWidget($params = array()) {
|
||||
// IMPORTANT: fixes conflict with MagicMember
|
||||
remove_shortcode('user_list');
|
||||
WPFunctions::get()->removeShortcode('user_list');
|
||||
|
||||
if (isset($params['id']) && (int)$params['id'] > 0) {
|
||||
$form_widget = new \MailPoet\Form\Widget();
|
||||
@@ -66,9 +66,9 @@ class Shortcodes {
|
||||
}
|
||||
|
||||
if (empty($segment_ids)) {
|
||||
return number_format_i18n(Subscriber::filter('subscribed')->count());
|
||||
return WPFunctions::get()->numberFormatI18n(Subscriber::filter('subscribed')->count());
|
||||
} else {
|
||||
return number_format_i18n(
|
||||
return WPFunctions::get()->numberFormatI18n(
|
||||
SubscriberSegment::whereIn('segment_id', $segment_ids)
|
||||
->select('subscriber_id')->distinct()
|
||||
->filter('subscribed')
|
||||
@@ -94,7 +94,7 @@ class Shortcodes {
|
||||
if (empty($newsletters)) {
|
||||
return $this->wp->applyFilters(
|
||||
'mailpoet_archive_no_newsletters',
|
||||
__('Oops! There are no newsletters to display.', 'mailpoet')
|
||||
WPFunctions::get()->__('Oops! There are no newsletters to display.', 'mailpoet')
|
||||
);
|
||||
} else {
|
||||
$title = $this->wp->applyFilters('mailpoet_archive_title', '');
|
||||
@@ -119,8 +119,8 @@ class Shortcodes {
|
||||
}
|
||||
|
||||
function renderArchiveDate($newsletter) {
|
||||
return date_i18n(
|
||||
get_option('date_format'),
|
||||
return WPFunctions::get()->dateI18n(
|
||||
WPFunctions::get()->getOption('date_format'),
|
||||
strtotime($newsletter->processed_at)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user