Skip to content

Commit

Permalink
fix: update token option.
Browse files Browse the repository at this point in the history
  • Loading branch information
devuri committed Jan 25, 2021
1 parent ff2712c commit cddbdd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/InstagramData.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public static function refresh_token() {
* Notify admin.
*/
$admin_user = get_option( 'admin_email' );
$subject = 'Re: Access Token update ' . wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
$subject = 'New: '. $user_token['created_at'] . ' Access Token Update ' . wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );

// email message.
$message = __(
Expand Down Expand Up @@ -285,6 +285,9 @@ public static function refresh_token() {
$message = str_replace( '###EXPIRES###', $token_will_expire, $message );
$message = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $message );

// update token option.
update_option('simsf_access_token', $user_token );

// send email.
wp_mail( $admin_user, $subject, $message );

Expand Down

0 comments on commit cddbdd5

Please sign in to comment.