oauth_get_data

The All In One SEO Pack oauth get data function.

Description

(array|WP_Error) oauth_get_data( $oauth_url, (null) $args = null ); 

Returns (array|WP_Error)

Parameters (2)

0. $oauth_url
The oauth url.
1. $args — Optional. (null) => null
The args.

Usage

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

Defined (1)

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

/inc/deprecated.php  
  1. function oauth_get_data( $oauth_url, $args = null ) { 
  2. if ( ! class_exists( 'OAuthConsumer' ) ) { 
  3. require_once( AIOSEOP_PLUGIN_DIR . 'inc/extlib/OAuth.php' ); 
  4. if ( $args === null ) { 
  5. $args = Array( 
  6. 'scope' => 'https://www.googleapis.com/auth/analytics.readonly',  
  7. 'xoauth_displayname' => AIOSEOP_PLUGIN_NAME . ' ' . __( 'Google Analytics', 'all-in-one-seo-pack' ) 
  8. ); 
  9. $req_token = new OAuthConsumer( $this->token, $this->secret ); 
  10. $req = $this->oauth_get_creds( $oauth_url, $req_token, $args ); 
  11.  
  12. return wp_remote_get( $req->to_url() );