WC_Admin_Status::log_table_bulk_actions()private staticWC 3.0.0

Bulk DB log table actions.

Method of the class: WC_Admin_Status{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Admin_Status::log_table_bulk_actions();

Changelog

Since 3.0.0 Introduced.

WC_Admin_Status::log_table_bulk_actions() code WC 8.7.0

private static function log_table_bulk_actions() {
	check_admin_referer( 'bulk-logs' );

	if ( ! current_user_can( 'manage_woocommerce' ) ) {
		wp_die( esc_html__( 'You do not have permission to manage log entries.', 'woocommerce' ) );
	}

	$log_ids = (array) filter_input( INPUT_GET, 'log', FILTER_CALLBACK, array( 'options' => 'absint' ) );

	$action = self::get_db_log_list_table()->current_action();

	if ( 'delete' === $action ) {
		WC_Log_Handler_DB::delete( $log_ids );

		$sendback = remove_query_arg( array( 'action', 'action2', 'log', '_wpnonce', '_wp_http_referer' ), wp_get_referer() );

		wp_safe_redirect( $sendback );
		exit();
	}
}