Skip to content

Commit 4f47321

Browse files
committed
fix Getting and setting current user from pr #2
1 parent 098f89b commit 4f47321

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Factories/Coupon.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ public function get_object_by_id( $object_id ) {
7777
}
7878

7979
private function api_call_setup() {
80-
$this->old_user = wp_get_current_user();
80+
$this->old_user = get_current_user_id();
8181

8282
// Setup the administrator user so we can actually retrieve the order.
8383
$user = new \WP_User( 1 );
84-
wp_set_current_user( $user );
84+
wp_set_current_user( $user->ID );
8585
}
8686

8787

0 commit comments

Comments
 (0)