本文整理汇总了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();
}
示例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;
}