Ejemplo n.º 1
0
 /**
  * pretty much a helper function to set up the request
  */
 public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL)
 {
     @$parameters or $parameters = array();
     $defaults = array("oauth_version" => WP_OAuthRequest::$version, "oauth_nonce" => WP_OAuthRequest::generate_nonce(), "oauth_timestamp" => WP_OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key);
     if ($token) {
         $defaults['oauth_token'] = $token->key;
     }
     $parameters = array_merge($defaults, $parameters);
     return new WP_OAuthRequest($http_method, $http_url, $parameters);
 }