From cddbdd51d129cacef7ae1c5fc9813ae1d9fcb4ac Mon Sep 17 00:00:00 2001 From: devuri Date: Mon, 25 Jan 2021 01:42:39 -0500 Subject: [PATCH] fix: update token option. --- src/InstagramData.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/InstagramData.php b/src/InstagramData.php index e73ff0a..23d9a75 100644 --- a/src/InstagramData.php +++ b/src/InstagramData.php @@ -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 = __( @@ -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 );