Closed drewbaker closed 8 years ago
Today we re-wrote the username to ID conversion to be case insensitive and work if the search result order came back not what we expected.
https://github.com/jrobson153/funkstagram/blob/master/funkstagram-class.php#L40-L52
// Decode JSON response $response = json_decode( wp_remote_retrieve_body( $serach_user ), true ); // Go through serach results and find matching username $found_id = false; foreach($response['data'] as $key => $found_user) { if(strtolower($found_user['username']) == strtolower($user)) { $found_id = $response['data'][$key]['id']; break; } } // If username matches, switch username to be id instead if ( $found_id ) { $user_ids[$i] = $found_id; // Otherwise remove from array and log } else { unset( $user_ids[$i] ); $this->error_log[] = 'User ' . $user . ' does not exist'; }
Today we re-wrote the username to ID conversion to be case insensitive and work if the search result order came back not what we expected.
https://github.com/jrobson153/funkstagram/blob/master/funkstagram-class.php#L40-L52