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


PHP WPSC_Purchase_Log::delete方法代码示例

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


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

示例1: wpsc_delete_purchlog

/**
 * Delete a purchase log
 *
 * @deprecated  Use WPSC_Purchase_Log->delete() instead.
 *
 * @param   int|string  $purchlog_id  Required. Purchase log ID (empty string is deprecated).
 * @return  boolean                   Deleted successfully.
 */
function wpsc_delete_purchlog($purchlog_id = '')
{
    global $wpdb;
    // Deprecate empty purchase log ID parameter.
    if ($purchlog_id == '') {
        _wpsc_doing_it_wrong('wpsc_delete_purchlog', __('$purchlog_id parameter requires a numeric purchase log ID.', 'wp-e-commerce'), '3.9.0');
        return false;
    }
    $log = new WPSC_Purchase_Log($purchlog_id);
    return $log->delete();
}
开发者ID:ashik968,项目名称:digiplot,代码行数:19,代码来源:init.php

示例2: process_bulk_action

 public function process_bulk_action()
 {
     global $wpdb;
     $current_action = $this->list_table->current_action();
     do_action('wpsc_sales_log_process_bulk_action', $current_action);
     if (!$current_action || 'download_csv' != $current_action && empty($_REQUEST['post'])) {
         if (!empty($_REQUEST['_wp_http_referer'])) {
             wp_redirect(esc_url_raw(remove_query_arg(array('_wp_http_referer', '_wpnonce', 'action', 'action2'), stripslashes($_SERVER['REQUEST_URI']))));
             exit;
         }
         unset($_REQUEST['post']);
         return;
     }
     if ('download_csv' == $current_action) {
         $this->download_csv();
         exit;
     }
     $sendback = remove_query_arg(array('_wpnonce', '_wp_http_referer', 'action', 'action2', 'confirm', 'post', 'last_paged'));
     if ('delete' == $current_action) {
         // delete action
         if (empty($_REQUEST['confirm'])) {
             $this->list_table->disable_search_box();
             $this->list_table->disable_bulk_actions();
             $this->list_table->disable_sortable();
             $this->list_table->disable_month_filter();
             $this->list_table->disable_views();
             $this->list_table->set_per_page(0);
             add_action('wpsc_purchase_logs_list_table_before', array($this, 'action_list_table_before'));
             return;
         } else {
             if (empty($_REQUEST['post'])) {
                 return;
             }
             $ids = array_map('intval', $_REQUEST['post']);
             foreach ($ids as $id) {
                 $log = new WPSC_Purchase_Log($id);
                 $log->delete();
             }
             $sendback = add_query_arg(array('paged' => $_REQUEST['last_paged'], 'deleted' => count($_REQUEST['post'])), $sendback);
         }
     }
     // change status actions
     if (is_numeric($current_action) && !empty($_REQUEST['post'])) {
         foreach ($_REQUEST['post'] as $id) {
             wpsc_purchlog_edit_status($id, $current_action);
         }
         $sendback = add_query_arg(array('updated' => count($_REQUEST['post'])), $sendback);
     }
     wp_redirect(esc_url_raw($sendback));
     exit;
 }
开发者ID:RJHanson292,项目名称:WP-e-Commerce,代码行数:51,代码来源:display-sales-logs.php


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