From 77a5b601edb106f2301fd2b6940f42ca1a3d8d82 Mon Sep 17 00:00:00 2001 From: profetes Date: Tue, 25 Mar 2014 17:22:48 +0100 Subject: [PATCH] WC API: can generate API keys for different user than the one that is making request --- includes/admin/class-wc-admin-profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/class-wc-admin-profile.php b/includes/admin/class-wc-admin-profile.php index 59cc3f09a38..f507030a2fa 100644 --- a/includes/admin/class-wc-admin-profile.php +++ b/includes/admin/class-wc-admin-profile.php @@ -236,7 +236,7 @@ class WC_Admin_Profile { if ( current_user_can( 'edit_user', $user_id ) ) { - $user = wp_get_current_user(); + $user = get_userdata( $user_id ); // creating/deleting key if ( isset( $_POST['woocommerce_generate_api_key'] ) ) {