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


PHP SendPress_Admin::redirect方法代码示例

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


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

示例1: save

 function save()
 {
     $_POST['post_type'] = SendPress_Data::email_post_type();
     // Update post 37 (37!)
     $my_post = _wp_translate_postdata(true);
     $system_emails = SendPress_Option::base_get('system-emails');
     $my_post['post_status'] = 'sp-systememail';
     $my_post['post_content'] = SendPress_Data::get_sysemail_content($_POST['email_type']);
     // Update the post into the database
     wp_update_post($my_post);
     update_post_meta($my_post['ID'], '_sendpress_subject', $_POST['post_subject']);
     update_post_meta($my_post['ID'], '_sendpress_template', $_POST['template']);
     update_post_meta($my_post['ID'], '_sendpress_status', 'private');
     update_post_meta($my_post['ID'], '_sendpress_system', 'new');
     update_post_meta($my_post['ID'], '_system_email_type', $_POST['email_type']);
     update_post_meta($my_post['ID'], '_system_default', $_POST['default']);
     if ($_POST['default']) {
         //set default system e-mail for this type
         SendPress_Data::set_system_email_default($my_post['ID'], $_POST['email_type']);
     }
     SendPress_Email::set_default_style($my_post['ID']);
     //clear the cached file.
     delete_transient('sendpress_email_html_' . $my_post['ID']);
     if (!in_array($_POST['email_type'], $system_emails)) {
         $system_emails[] = $_POST['email_type'];
     }
     SendPress_Option::base_set('system-emails', $system_emails);
     SendPress_Admin::redirect('Settings_Emailedit', array('emailID' => $my_post['ID']));
     //$this->save_redirect( $_POST  );
 }
开发者ID:pmatheus,项目名称:participacao-sitebase,代码行数:30,代码来源:class-sendpress-view-settings-systememailcreate.php

示例2: save

 function save($post, $sp)
 {
     $options = SendPress_Option::get('notification_options');
     $options['email'] = $post['toemail'];
     $options['notifications-enable'] = array_key_exists('notifications-enable', $post) ? true : false;
     if ($options['notifications-enable']) {
         $options['subscribed'] = $post['subscribed'];
         $options['unsubscribed'] = $post['unsubscribed'];
         $options['send-to-admins'] = array_key_exists('send-to-admins', $post) ? true : false;
     }
     $options['enable-hipchat'] = array_key_exists('enable-hipchat', $post) ? true : false;
     $options['hipchat-api'] = $post['hipchat-api'];
     if (strlen($options['hipchat-api']) > 0) {
         $options['hipchat-rooms'] = array();
         if (!array_key_exists('hipchat-rooms', $post)) {
             $post['hipchat-rooms'] = array();
         }
         global $hc;
         $hc = new SendPress_HipChat($options['hipchat-api'], 'https://api.hipchat.com');
         try {
             foreach ($hc->get_rooms() as $room) {
                 $options['hipchat-rooms'][$room->room_id] = array_key_exists($room->room_id, $post['hipchat-rooms']) ? true : false;
             }
         } catch (Exception $e) {
             $options['hipchat-room'] = $post['hipchat-room'];
         }
     }
     $options = apply_filters('sendpress_notification_settings_save', $options, $post, $sp);
     SendPress_Option::set('notification_options', $options);
     SendPress_Admin::redirect('Settings_Notifications');
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:31,代码来源:class-sendpress-view-settings-notifications.php

示例3: save

 function save($post, $sp)
 {
     // print_r($post);
     // die();
     $action = isset($post['form_action']) ? $post['form_action'] : 'save';
     switch ($action) {
         case 'copy':
             $postid = SendPress_Data::create_settings_post($post['post_subject'], "", $post['copy_from']);
             //wp_redirect( '?page=sp-settings&view=widgets&id='. $postid );
             SendPress_Admin::redirect('Settings_Widgets', array('id' => $postid));
             break;
         case 'create':
             $postid = SendPress_Data::create_settings_post($post['post_subject'], $post['form_type']);
             //wp_redirect( '?page=sp-settings&view=widgets&id='. $postid );
             SendPress_Admin::redirect('Settings_Widgets', array('id' => $postid));
             break;
         case 'delete':
             self::delete_form_save($post, $sp);
             //wp_redirect( '?page=sp-settings&view=widgets' );
             SendPress_Admin::redirect('Settings_Widgets');
             break;
         default:
             self::save_form($post, $sp);
             break;
     }
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:26,代码来源:class-sendpress-view-settings-widgets.php

示例4: save

 function save()
 {
     if (isset($_POST['delete-this-user']) && $_POST['delete-this-user'] == 'yes') {
         SendPress_Data::delete_subscriber($_POST['subscriberID']);
         if ($_GET['listID']) {
             SendPress_Admin::redirect('Subscribers_Subscribers', array('listID' => $_GET['listID']));
         } else {
             SendPress_Admin::redirect('Subscribers_All');
         }
     } else {
         global $post;
         $subscriber_info = array('email' => $_POST['email'], 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname']);
         SendPress_Data::update_subscriber($_POST['subscriberID'], $subscriber_info);
         $args = array('post_type' => 'sendpress_list', 'post_status' => array('publish', 'draft'), 'posts_per_page' => 100, 'order' => 'ASC', 'orderby' => 'title');
         $postslist = get_posts($args);
         foreach ($postslist as $post) {
             setup_postdata($post);
             if (isset($_POST[$post->ID . "-status"]) && $_POST[$post->ID . "-status"] > 0) {
                 SendPress_Data::update_subscriber_status($post->ID, $_POST['subscriberID'], $_POST[$post->ID . "-status"]);
             } else {
                 SendPress_Data::remove_subscriber_status($post->ID, $_POST['subscriberID']);
             }
             $notifications = SendPress_Data::get_post_notification_types();
             if (isset($_POST[$post->ID . "-pn"]) && array_key_exists($_POST[$post->ID . "-pn"], $notifications)) {
                 SendPress_Data::update_subscriber_meta($_POST['subscriberID'], 'post_notifications', $_POST[$post->ID . "-pn"], $post->ID);
             }
         }
         wp_reset_postdata();
     }
     SendPress_Admin::redirect('Subscribers_Subscriber', array('subscriberID' => $_POST['subscriberID']));
 }
开发者ID:pmatheus,项目名称:participacao-sitebase,代码行数:31,代码来源:class-sendpress-view-subscribers-subscriber.php

示例5: save

 function save()
 {
     //$this->security_check();
     $_POST['post_type'] = SendPress_Data::email_post_type();
     // Update post 37 (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);
     update_post_meta($my_post['ID'], '_sendpress_subject', $_POST['post_subject']);
     update_post_meta($my_post['ID'], '_sendpress_template', $_POST['template']);
     update_post_meta($my_post['ID'], '_sendpress_status', 'private');
     update_post_meta($my_post['ID'], '_sendpress_system', $_POST['template_system']);
     SendPress_Email::set_default_style($my_post['ID']);
     //clear the cached file.
     delete_transient('sendpress_email_html_' . $my_post['ID']);
     if ($_POST['template_system'] == 'new') {
         SendPress_Admin::redirect('Emails_Edit', array('emailID' => $my_post['ID']));
     }
     SendPress_Admin::redirect('Emails_Style', array('emailID' => $my_post['ID']));
     //$this->save_redirect( $_POST  );
 }
开发者ID:redelivre,项目名称:jaiminho,代码行数:27,代码来源:class-jaiminho-view-emails-create.php

示例6: save

 function save()
 {
     //$this->security_check();
     $saveid = SPNL()->validate->_int('post_ID');
     update_post_meta($saveid, 'send_date', date('Y-m-d H:i:s'));
     $email_post = get_post($saveid);
     $subject = SendPress_Option::get('current_send_subject_' . $saveid);
     $info = SendPress_Option::get('current_send_' . $saveid);
     $slug = SendPress_Data::random_code();
     $new_id = SendPress_Posts::copy($email_post, $subject, $slug, SPNL()->_report_post_type);
     SendPress_Posts::copy_meta_info($new_id, $saveid);
     $lists = implode(',', $info['listIDS']);
     update_post_meta($new_id, '_send_time', $info['send_at']);
     update_post_meta($new_id, '_send_lists', $lists);
     update_post_meta($new_id, '_stat_type', 'new');
     $count = 0;
     if (get_post_meta($saveid, 'istest', true) == true) {
         update_post_meta($new_id, '_report_type', 'test');
     }
     update_post_meta($new_id, '_sendpress_subject', $subject);
     if (isset($info['testemails']) && $info['testemails'] != false) {
         foreach ($info['testemails'] as $email) {
             $go = array('from_name' => 'Josh', 'from_email' => 'joshlyford@gmail.com', 'to_email' => $email['email'], 'emailID' => $new_id, 'subscriberID' => 0, 'subject' => $subject, 'listID' => 0);
             SPNL()->add_email_to_queue($go);
             $count++;
         }
     }
     update_post_meta($new_id, '_send_count', $count);
     SendPress_Admin::redirect('Emails_Send_Queue', array('emailID' => $new_id));
 }
开发者ID:redelivre,项目名称:jaiminho,代码行数:30,代码来源:class-jaiminho-view-emails-send-confirm.php

示例7: save

 function save()
 {
     $post = get_default_post_to_edit('sp_template', true);
     $post_ID = $post->ID;
     global $current_user;
     $content = '';
     switch ($_POST['starter']) {
         case 'blank':
             $content = '';
             break;
         default:
             $content = 'Default HTML';
             break;
     }
     /*            
     $my_post['ID'] = $_POST['post_ID'];
     $my_post['post_content'] = $_POST['content'];
     $my_post['post_title'] = $_POST['post_title'];
     */
     $post->post_title = $_POST['post_title'];
     $post->post_status = 'sp-custom';
     $post->post_content = $content;
     // Update the post into the database
     wp_update_post($post);
     //SendPress_Email::set_default_style( $my_post['ID'] );
     //clear the cached file.
     SendPress_Admin::redirect('Emails_Tempedit', array('templateID' => $post->ID));
     //$this->save_redirect( $_POST  );
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:29,代码来源:class-sendpress-view-emails-tempcreate.php

示例8: 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']));
     }
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:30,代码来源:class-sendpress-view-emails-send.php

示例9: save

 function save($post, $sp)
 {
     $saveid = $_POST['post_ID'];
     update_post_meta($saveid, 'send_date', date('Y-m-d H:i:s'));
     $email_post = get_post($saveid);
     $subject = SendPress_Option::get('current_send_subject_' . $saveid);
     $info = SendPress_Option::get('current_send_' . $saveid);
     $slug = SendPress_Data::random_code();
     $new_id = SendPress_Posts::copy($email_post, $subject, $slug, $sp->_report_post_type);
     SendPress_Posts::copy_meta_info($new_id, $saveid);
     $lists = implode(',', $info['listIDS']);
     update_post_meta($new_id, '_send_time', $info['send_at']);
     update_post_meta($new_id, '_send_lists', $lists);
     update_post_meta($new_id, '_stat_type', 'new');
     $count = 0;
     if (get_post_meta($saveid, 'istest', true) == true) {
         update_post_meta($new_id, '_report_type', 'test');
     }
     update_post_meta($new_id, '_sendpress_subject', $subject);
     /*
     
             if(isset($info['listIDS'])){
                // foreach($info['listIDS'] as $list_id){
         $_email = SendPress_Data::get_active_subscribers_lists($info['listIDS']); //$sp->get_active_subscribers( $list_id );
     
         foreach($_email as $email){
            
              $go = array(
                 'from_name' => '',
                 'from_email' => '',
                 'to_email' => $email->email,
                 'emailID'=> $new_id,
                 'subscriberID'=> $email->subscriberID,
                 //'to_name' => $email->fistname .' '. $email->lastname,
                 'subject' => '',
                 'listID'=> $email->listid
                 );
            
             $sp->add_email_to_queue($go);
             $count++;
     
         }
     
     
               //  }
             }
     */
     if (isset($info['testemails']) && $info['testemails'] != false) {
         foreach ($info['testemails'] as $email) {
             $go = array('from_name' => 'Josh', 'from_email' => 'joshlyford@gmail.com', 'to_email' => $email['email'], 'emailID' => $new_id, 'subscriberID' => 0, 'subject' => $subject, 'listID' => 0);
             $sp->add_email_to_queue($go);
             $count++;
         }
     }
     update_post_meta($new_id, '_send_count', $count);
     // update_post_meta($new_id,'_send_data', $info );
     SendPress_Admin::redirect('Emails_Send_Queue', array('emailID' => $new_id));
     //wp_redirect( '?page=sp-queue' );
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:59,代码来源:class-sendpress-view-emails-send-confirm.php

示例10: save

 function save()
 {
     $saveid = SPNL()->validate->int($_GET['templateID']);
     if ($saveid > 0) {
         update_post_meta($saveid, '_footer_page', $_POST['footer-content']);
         SendPress_Admin::redirect('Emails_Footerpage', array('templateID' => $saveid));
     }
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:8,代码来源:class-sendpress-view-emails-footerpage.php

示例11: save

 function save()
 {
     $template = get_post($_POST['post_ID']);
     $template->post_content = stripcslashes($_POST['template-content']);
     $template->post_title = $_POST['post_subject'];
     wp_update_post($template);
     SendPress_Admin::redirect('Emails_Tempedit', array('templateID' => $_GET['templateID']));
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:8,代码来源:class-sendpress-view-emails-tempedit.php

示例12: save

 function save($data, $sp)
 {
     $saveid = SPNL()->validate->int($_POST['post_ID']);
     if ($saveid > 0) {
         $bodybg = SPNL()->validate->hex($_POST['body_bg']);
         $bodytext = SPNL()->validate->hex($_POST['body_text']);
         $bodylink = SPNL()->validate->hex($_POST['body_link']);
         $contentbg = SPNL()->validate->hex($_POST['content_bg']);
         $contenttext = SPNL()->validate->hex($_POST['content_text']);
         $contentlink = SPNL()->validate->hex($_POST['sp_content_link_color']);
         $contentborder = SPNL()->validate->hex($_POST['content_border']);
         $upload_image = $_POST['upload_image'];
         $headerbg = SPNL()->validate->hex($_POST['header_bg']);
         $headertextcolor = SPNL()->validate->hex($_POST['header_text_color']);
         $headertext = sanitize_text_field($_POST['header_text']);
         $headerlink = esc_url_raw($_POST['header_link']);
         $imageheaderurl = esc_url_raw($_POST['image_header_url']);
         $subheadertext = sanitize_text_field($_POST['sub_header_text']);
         $activeHeader = $_POST['active_header'];
         update_post_meta($saveid, 'upload_image', $upload_image);
         update_post_meta($saveid, 'body_bg', $bodybg);
         update_post_meta($saveid, 'body_text', $bodytext);
         update_post_meta($saveid, 'body_link', $bodylink);
         update_post_meta($saveid, 'content_bg', $contentbg);
         update_post_meta($saveid, 'content_text', $contenttext);
         update_post_meta($saveid, 'sp_content_link_color', $contentlink);
         update_post_meta($saveid, 'content_border', $contentborder);
         update_post_meta($saveid, 'header_bg', $headerbg);
         update_post_meta($saveid, 'header_text_color', $headertextcolor);
         update_post_meta($saveid, 'header_text', $headertext);
         update_post_meta($saveid, 'header_link', $headerlink);
         update_post_meta($saveid, 'image_header_url', $imageheaderurl);
         update_post_meta($saveid, 'sub_header_text', $subheadertext);
         update_post_meta($saveid, 'active_header', $activeHeader);
         $canspam = sanitize_text_field($_POST['can-spam']);
         $linkedin = '';
         if (isset($_POST['linkedin'])) {
             $linkedin = esc_url_raw($_POST['linkedin']);
         }
         $twitter = '';
         if (isset($_POST['twitter'])) {
             $twitter = esc_url_raw($_POST['twitter']);
         }
         $facebook = '';
         if (isset($_POST['facebook'])) {
             $facebook = esc_url_raw($_POST['facebook']);
         }
         if (isset($_POST['fromname'])) {
             $fromname = sanitize_text_field($_POST['fromname']);
         }
         SendPress_Option::set('canspam', $canspam);
         SendPress_Option::set('linkedin', $linkedin);
         SendPress_Option::set('facebook', $facebook);
         SendPress_Option::set('twitter', $twitter);
     }
     // SendPress_Option::set('unsubscribetext', $unsubtext);
     SendPress_Admin::redirect('Settings_Styles');
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:58,代码来源:class-sendpress-view-settings-styles.php

示例13: save

 function save()
 {
     $postdata = get_post($_GET['templateID']);
     $new_post = SendPress_Posts::copy($postdata, $_POST['post_title'], '', '');
     SendPress_Posts::copy_meta_info($new_post, $_GET['templateID']);
     update_post_meta($new_post, '_template_type', 'clone');
     update_post_meta($new_post, '_guid', '');
     SendPress_Admin::redirect('Emails_Tempstyle', array('templateID' => $new_post));
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:9,代码来源:class-sendpress-view-emails-tempclone.php

示例14: delete_subscribers_bulk_all

 static function delete_subscribers_bulk_all()
 {
     if (isset($_GET['subscriber']) && is_array($_GET['subscriber'])) {
         foreach ($_GET['subscriber'] as $value) {
             SendPress_Data::delete_subscriber($value);
         }
     }
     SendPress_Admin::redirect('Subscribers_All');
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:9,代码来源:class-sendpress-view-subscribers-all.php

示例15: save

 function save($post, $sp)
 {
     $value = $_POST['submit'];
     if ($value == 'delete') {
         SendPress_Data::remove_from_queue($_POST['post_ID']);
         update_post_meta($_POST['post_ID'], '_canceled', true);
     }
     SendPress_Admin::redirect('Reports');
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:9,代码来源:class-sendpress-view-emails-send-cancel.php


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