本文整理汇总了PHP中Newsletter::subscription_form方法的典型用法代码示例。如果您正苦于以下问题:PHP Newsletter::subscription_form方法的具体用法?PHP Newsletter::subscription_form怎么用?PHP Newsletter::subscription_form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Newsletter
的用法示例。
在下文中一共展示了Newsletter::subscription_form方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Newsletter
<?php
require_once '../../../../wp-load.php';
if (!isset($newsletter)) {
$newsletter = new Newsletter();
}
$options_main = get_option('newsletter_main', array());
$options = get_option('newsletter', array());
$text = trim($options['subscription_popup_text']);
if (empty($text)) {
$text = $options['subscription_text'];
}
if (stripos($text, '<form') !== false) {
$message = str_ireplace('<form', '<form method="post" action="' . NEWSLETTER_SUBSCRIBE_POPUP_URL . '" onsubmit="return newsletter_check(this)"', $options['subscription_text']);
$message = $this->replace_lists($message);
} else {
$form = $newsletter->subscription_form(null, true, NEWSLETTER_SUBSCRIBE_POPUP_URL);
if (strpos($options['subscription_text'], '{subscription_form}') !== false) {
$message = str_replace('{subscription_form}', $form, $text);
} else {
$message = $text . $form;
}
}
include NEWSLETTER_DIR . '/popup.php';
示例2: Newsletter
<?php
require_once '../../../../wp-load.php';
if (!isset($newsletter)) {
$newsletter = new Newsletter();
}
$options_main = get_option('newsletter_main', array());
if (!empty($options_main['url'])) {
header('Location: ' . $options_main['url']);
die;
}
$options = get_option('newsletter', array());
if (stripos($options['subscription_text'], '<form') !== false) {
$message = str_ireplace('<form', '<form method="post" action="' . plugins_url('newsletter/do/subscribe.php') . '" onsubmit="return newsletter_check(this)"', $options['subscription_text']);
$message = $this->replace_lists($message);
} else {
$form = $newsletter->subscription_form();
if (strpos($options['subscription_text'], '{subscription_form}') !== false) {
$message = str_replace('{subscription_form}', $form, $options['subscription_text']);
} else {
$message = $options['subscription_text'] . $form;
}
}
include NEWSLETTER_DIR . '/page.php';