本文整理汇总了PHP中SendPress_Data::subscriber_csv_post_to_array方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Data::subscriber_csv_post_to_array方法的具体用法?PHP SendPress_Data::subscriber_csv_post_to_array怎么用?PHP SendPress_Data::subscriber_csv_post_to_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SendPress_Data
的用法示例。
在下文中一共展示了SendPress_Data::subscriber_csv_post_to_array方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
if (isset($_POST['send-date']) && $_POST['send-date'] == 'later') {
$send_at = $_POST['date-pickit'] . " " . $_POST['send-later-time'];
} else {
$send_at = '0000-00-00 00:00:00';
}
if (isset($_POST['test-add'])) {
$csvadd = "email,firstname,lastname\n" . trim($_POST['test-add']);
$data = SendPress_Data::subscriber_csv_post_to_array($csvadd);
} else {
$data = false;
}
$listids = isset($_POST['listIDS']) ? $_POST['listIDS'] : array();
SendPress_Option::set('current_send_' . $_POST['post_ID'], array('listIDS' => $listids, 'testemails' => $data, 'send_at' => $send_at));
SendPress_Option::set('current_send_subject_' . $_POST['post_ID'], $_POST['post_subject']);
if (isset($_POST['test_report'])) {
update_post_meta($_POST['post_ID'], 'istest', true);
} else {
update_post_meta($_POST['post_ID'], 'istest', false);
}
if (isset($_POST['google-campaign-name'])) {
update_post_meta($_POST['post_ID'], 'google-campaign-name', $_POST['google-campaign-name']);
}
if (isset($_POST['submit']) && $_POST['submit'] == 'save-next') {
SendPress_Admin::redirect('Emails_Send_Confirm', array('emailID' => $_GET['emailID']));
} else {
SendPress_Admin::redirect('Emails_Style', array('emailID' => $_GET['emailID']));
}
}
示例2: create_subscribers
function create_subscribers()
{
$csvadd = "email,firstname,lastname\n" . trim($_POST['csv-add']);
$listID = SPNL()->validate->int($_POST['listID']);
if ($listID > 0) {
$newsubscribers = SendPress_Data::subscriber_csv_post_to_array($csvadd);
foreach ($newsubscribers as $subscriberx) {
if (is_email(trim($subscriberx['email']))) {
$result = SendPress_Data::add_subscriber(array('firstname' => trim($subscriberx['firstname']), 'email' => trim($subscriberx['email']), 'lastname' => trim($subscriberx['lastname'])));
SendPress_Data::update_subscriber_status($listID, $result, 2, false);
}
}
}
wp_redirect(esc_url_raw(admin_url('admin.php?page=' . SPNL()->validate->page($_GET['page']) . "&view=subscribers&listID=" . $listID)));
}
示例3: subscriber_csv_post_to_array
function subscriber_csv_post_to_array($csv, $delimiter = ',', $enclosure = '"', $escape = '\\', $terminator = "\n")
{
return SendPress_Data::subscriber_csv_post_to_array($csv, $delimiter, $enclosure, $escape, $terminator);
}