WC_Admin_Status::log_table_bulk_actions() – Bulk DB log table actions.

You appear to be a bot. Output may be restricted

Description

Bulk DB log table actions.

Usage

WC_Admin_Status::log_table_bulk_actions();

Parameters

Returns

void

Source

File name: woocommerce/includes/admin/class-wc-admin-status.php
Lines:

1 to 13 of 13
  private static function log_table_bulk_actions() {
    if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-status-logs' ) ) { // WPCS: input var ok, sanitization ok.
      wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
    }

    $log_ids = array_map( 'absint', (array) isset( $_REQUEST['log'] ) ? wp_unslash( $_REQUEST['log'] ) : array() ); // WPCS: input var ok, sanitization ok.

    if ( ( isset( $_REQUEST['action'] ) && 'delete' === $_REQUEST['action'] ) || ( isset( $_REQUEST['action2'] ) && 'delete' === $_REQUEST['action2'] ) ) { // WPCS: input var ok, sanitization ok.
      WC_Log_Handler_DB::delete( $log_ids );
      wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wc-status&tab=logs' ) ) );
      exit();
    }
  }
 

 View on GitHub View on Trac