WordPress at Your Fingertips
function is not described

WC_Admin_API_Keys::bulk_revoke_key() private WC 1.0

Bulk revoke key.

{} It's a method of the class: WC_Admin_API_Keys{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->bulk_revoke_key( $keys );
$keys(array) (required)
API Keys.

Code of WC_Admin_API_Keys::bulk_revoke_key() WC 5.9.0

private function bulk_revoke_key( $keys ) {
	if ( ! current_user_can( 'remove_users' ) ) {
		wp_die( esc_html__( 'You do not have permission to revoke API Keys', 'woocommerce' ) );
	}

	$qty = 0;
	foreach ( $keys as $key_id ) {
		$result = $this->remove_key( $key_id );

		if ( $result ) {
			$qty++;
		}
	}

	// Redirect to webhooks page.
	wp_safe_redirect( esc_url_raw( add_query_arg( array( 'revoked' => $qty ), admin_url( 'admin.php?page=wc-settings&tab=advanced&section=keys' ) ) ) );
	exit();
}