Skip to content

Commit

Permalink
Merge dcfd135 into 50f6e39
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Jun 1, 2020
2 parents 50f6e39 + dcfd135 commit 64a3fa9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions php/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,15 @@ public function get_access_token( $code ) {
* @return mixed
*/
public function get_client_id( $access_token ) {
$response = wp_remote_post(
$url = get_home_url( null, '/' );
$credentials = $this->get_credentials();
$name = $credentials['utmSource'];
$response = wp_remote_post(
'https://api.unsplash.com/clients',
[
'body' => [
'name' => 'WordPress OAuth',
'description' => 'Client application for ' . get_bloginfo( 'name' ) . ' - ' . get_home_url( null, '/' ),
'name' => $name,
'description' => sprintf( 'Wordpress Oauth Client application for: %1$s - %2$s', $name, $url ),
],
'headers' => [
'Authorization' => 'Bearer ' . $access_token,
Expand Down

0 comments on commit 64a3fa9

Please sign in to comment.