当前位置: 首页>>代码示例>>PHP>>正文


PHP SendPress_Data::update_list方法代码示例

本文整理汇总了PHP中SendPress_Data::update_list方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Data::update_list方法的具体用法?PHP SendPress_Data::update_list怎么用?PHP SendPress_Data::update_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SendPress_Data的用法示例。


在下文中一共展示了SendPress_Data::update_list方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 function save()
 {
     $listid = $_POST['listID'];
     $name = $_POST['name'];
     $public = 0;
     if (isset($_POST['public']) && $_POST['sync_role'] == 'none') {
         $public = $_POST['public'];
     }
     SendPress_Data::update_list($listid, array('name' => $name, 'public' => $public));
     $roles_list = array();
     $test_list = 0;
     if (isset($_POST['test_list'])) {
         $public = $_POST['test_list'];
     }
     update_post_meta($listid, '_test_list', $_POST['test_list']);
     update_post_meta($listid, 'sync_role', $_POST['sync_role']);
     update_post_meta($listid, 'meta-key', $_POST['meta-key']);
     update_post_meta($listid, 'meta-compare', $_POST['meta-compare']);
     update_post_meta($listid, 'meta-value', $_POST['meta-value']);
     SendPress_Admin::redirect('Subscribers');
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:21,代码来源:class-sendpress-view-subscribers-listedit.php

示例2: save

 function save()
 {
     $listid = SPNL()->validate->int($_POST['listID']);
     if ($listid > 0) {
         $name = sanitize_text_field($_POST['name']);
         $public = 0;
         if (isset($_POST['public']) && $_POST['sync_role'] == 'none') {
             $public = SPNL()->validate->int($_POST['public']);
         }
         SendPress_Data::update_list($listid, array('name' => $name, 'public' => $public));
         $roles_list = array();
         $test_list = 0;
         if (isset($_POST['test_list'])) {
             $public = $_POST['test_list'];
         }
         update_post_meta($listid, '_test_list', $_POST['test_list']);
         update_post_meta($listid, 'sync_role', $_POST['sync_role']);
         update_post_meta($listid, 'meta-key', $_POST['meta-key']);
         update_post_meta($listid, 'meta-compare', $_POST['meta-compare']);
         update_post_meta($listid, 'meta-value', $_POST['meta-value']);
         update_post_meta($listid, 'opt-in-id', $_POST['opt-in-id']);
     }
     SendPress_Admin::redirect('Subscribers');
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:24,代码来源:class-sendpress-view-subscribers-listedit.php

示例3: sanitize_text_field

     $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;
     // Update post 37
     $my_post = _wp_translate_postdata(true);
     /*            
     $my_post['ID'] = $_POST['post_ID'];
     $my_post['post_content'] = $_POST['content'];
     $my_post['post_title'] = $_POST['post_title'];
     */
     $my_post['post_status'] = 'publish';
     // Update the post into the database
     wp_update_post($my_post);
开发者ID:richardsweeney,项目名称:sendpress,代码行数:31,代码来源:sendpress-post-actions.php

示例4: save_list

 function save_list()
 {
     global $wpdb;
     // Create the response array
     $response = array('success' => false);
     if ($_POST) {
         $s = new SendPress();
         // get the credit card details submitted by the form
         $listid = SPNL()->validate->int($_POST['id']);
         $name = sanitize_text_field($_POST['name']);
         $public = $_POST['public'] === '1' ? 1 : 0;
         $list = SendPress_Data::update_list($listid, array('name' => $name, 'public' => $public));
         if (false !== $list) {
             $response['success'] = true;
         } else {
             $response['error'] = $list;
         }
     }
     // Add additional processing here
     if ($response['success']) {
         // Succeess
     } else {
         // Failed
     }
     // Serialize the response back as JSON
     echo json_encode($response);
     die;
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:28,代码来源:class-sendpress-ajax-loader.php

示例5: updateList

 function updateList($listID, $values)
 {
     return SendPress_Data::update_list($listID, $values);
 }
开发者ID:pmatheus,项目名称:participacao-sitebase,代码行数:4,代码来源:sendpress.php


注:本文中的SendPress_Data::update_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。