oauth_get_token

The All In One SEO Pack oauth get token function.

Description

(array) oauth_get_token( $oauth_verifier ); 

Returns (array)

Parameters (1)

0. $oauth_verifier
The oauth verifier.

Usage

  1. if ( !function_exists( 'oauth_get_token' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'all-in-one-seo-pack/inc/deprecated.php'; 
  3.  
  4. // The oauth verifier. 
  5. $oauth_verifier = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = oauth_get_token($oauth_verifier); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/deprecated.php  
  1. function oauth_get_token( $oauth_verifier ) { 
  2. if ( ! class_exists( 'OAuthConsumer' ) ) { 
  3. require_once( AIOSEOP_PLUGIN_DIR . 'inc/extlib/OAuth.php' ); 
  4. $args = array( 
  5. 'scope' => 'https://www.google.com/analytics/feeds/',  
  6. 'xoauth_displayname' => AIOSEOP_PLUGIN_NAME . ' ' . __( 'Google Analytics', 'all-in-one-seo-pack' ) 
  7. ); 
  8. $args['oauth_verifier'] = $oauth_verifier; 
  9. $oauth_access_token = 'https://www.google.com/accounts/OAuthGetAccessToken'; 
  10. $reqData = $this->oauth_get_data( $oauth_access_token, $args ); 
  11. $reqOAuthData = OAuthUtil::parse_parameters( wp_remote_retrieve_body( $reqData ) ); 
  12.  
  13. return $reqOAuthData;