Created
August 31, 2020 19:05
-
-
Save topher1kenobe/119956fdea2f2cadf36f767f77dd86c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Get the auth token from local option | |
* | |
* @access public | |
* @return NULL | |
*/ | |
public function get_local_auth_token() { | |
// get the token from the options table | |
$this->auth_token = get_option( 'bigcommerce_auth_token' ); | |
// if the local copy is empty, go get one from BigCommerce | |
if ( empty( $this->auth_token ) ) { | |
// get the token | |
$token = $this->get_remote_auth_token(); | |
// set the local copy for next time | |
update_option( 'bigcommerce_auth_token', $token ); | |
// set the token for this instance | |
$this->auth_token = $token; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment