本文整理汇总了PHP中Newsletter::normalize_email方法的典型用法代码示例。如果您正苦于以下问题:PHP Newsletter::normalize_email方法的具体用法?PHP Newsletter::normalize_email怎么用?PHP Newsletter::normalize_email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Newsletter
的用法示例。
在下文中一共展示了Newsletter::normalize_email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Newsletter
if (!isset($newsletter)) {
$newsletter = new Newsletter();
}
$key = stripslashes($_REQUEST['nk']);
if (empty($newsletter->options['api_key']) || $key != $newsletter->options['api_key']) {
echo json_encode(array("message" => 'Wrong API key'));
exit;
}
if (!is_email($_REQUEST['ne'])) {
echo json_encode(array("message" => 'Wrong email'));
exit;
}
$subscriber = array();
$subscriber['name'] = stripslashes($_REQUEST['nn']);
$subscriber['surname'] = stripslashes($_REQUEST['ns']);
$subscriber['email'] = $newsletter->normalize_email(stripslashes($_REQUEST['ne']));
if (is_array($_REQUEST['nl'])) {
foreach ($_REQUEST['nl'] as $add_list) {
$subscriber['list_' . $add_list] = 1;
}
} else {
if (!empty($_REQUEST['nl'])) {
$add_lists = explode('|', $_REQUEST['nl']);
foreach ($add_lists as $add_list) {
$subscriber['list_' . $add_list] = 1;
}
}
}
$options_feed = get_option('newsletter_feed', array());
if ($options_feed['add_new'] == 1) {
$subscriber['feed'] = 1;
示例2: Newsletter
<?php
include '../../../../wp-load.php';
if (!isset($newsletter)) {
$newsletter = new Newsletter();
}
$key = stripslashes($_REQUEST['nk']);
if (empty(trim($newsletter->options['api_key'])) || $key != $newsletter->options['api_key']) {
die('Wrong API key');
}
$email = $newsletter->normalize_email(stripslashes($_REQUEST['ne']));
$r = $wpdb->query($wpdb->prepare("delete from " . NEWSLETTER_USERS_TABLE . " where email=%s", $email));
die($r = 0 ? 'ko' : 'ok');