Changes between Version 2 and Version 3 of Ticket #40042, comment 1
- Timestamp:
- 03/06/2017 12:10:42 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #40042, comment 1
v2 v3 22 22 23 23 24 Now i know i can code around this issue. But that is very cumbersome as i first have to get the users recordand compare the author_name (which) is the login name to the user login name;24 Now i know i can code around this issue. But that is very cumbersome as i have to get the users records and compare the author_name (which) is the login name to the user login name; 25 25 26 26 The question is why in the first time the action is called the $query does not have the user id set? … … 36 36 $authorname=$author_id; 37 37 $author_id=''; 38 $users = get_users( array( 'fields' => array( 'ID' ) ) ); 39 foreach($users as $user_id){ 40 $user_info = get_userdata($user_id->ID); 41 if ($authorname==$user_info->user_login) { 42 $author_id=$user_id->ID; 38 $users = get_users( array( 'fields' => array( 'ID', 'user_login' ) ) ); 39 foreach($users as $user){ 40 if ($authorname==$user->user_login) { 41 $author_id=$user->ID; 43 42 break; 44 43 }