WC_Helper::_flush_authentication_cache()
Flush auth cache.
Method of the class: WC_Helper{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_Helper::_flush_authentication_cache();
WC_Helper::_flush_authentication_cache() WC Helper:: flush authentication cache code WC 9.6.1
public static function _flush_authentication_cache() { $request = WC_Helper_API::get( 'oauth/me', array( 'authenticated' => true, 'timeout' => 30, ) ); if ( wp_remote_retrieve_response_code( $request ) !== 200 ) { return false; } $user_data = json_decode( wp_remote_retrieve_body( $request ), true ); if ( ! $user_data ) { return false; } WC_Helper_Options::update( 'auth_user_data', array( 'name' => $user_data['name'], 'email' => $user_data['email'], ) ); return true; }