本文整理汇总了PHP中SendPress_Data::create_list方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Data::create_list方法的具体用法?PHP SendPress_Data::create_list怎么用?PHP SendPress_Data::create_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SendPress_Data
的用法示例。
在下文中一共展示了SendPress_Data::create_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
$name = $_POST['name'];
$public = 0;
if (isset($_POST['public']) && $_POST['sync_role'] == 'none') {
$public = $_POST['public'];
}
$list_id = SendPress_Data::create_list(array('name' => $name, 'public' => $public));
update_post_meta($list_id, 'sync_role', $_POST['sync_role']);
SendPress_Admin::redirect('Subscribers');
}
示例2: switch
/**
*
* SENDPRESS ACTIONS
*
* see @sendpress class line 101
* Handles saving data and other user actions.
*
**/
switch ($this->_current_action) {
case 'create-list':
$name = sanitize_text_field($_POST['name']);
$public = 0;
if (isset($_POST['public'])) {
$public = SPNL()->validate->int($_POST['public']);
}
SendPress_Data::create_list(array('name' => $name, 'public' => $public));
wp_redirect(esc_url_raw(admin_url('admin.php?page=' . SPNL()->validate->page($_GET['page']))));
break;
case 'edit-list':
$listid = SPNL()->validate->int($_POST['listID']);
$name = sanitize_text_field($_POST['name']);
$public = 0;
if (isset($_POST['public'])) {
$public = $_POST['public'];
}
SendPress_Data::update_list($listid, array('name' => $name, 'public' => $public));
$page = apply_filters('sendpress_edit_list_redirect', SPNL()->validate->page($_GET['page']));
wp_redirect(esc_url_raw(admin_url('admin.php?page=' . $page)));
break;
case 'save-email':
$_POST['post_type'] = $this->_email_post_type;
示例3: createList
function createList($values)
{
return SendPress_Data::create_list($values);
}