Advertisement
Guest User

Untitled

a guest
Dec 18th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. // Please find this function
  2. function get_facebook_object( $object_id ) {
  3.     $url = $this->build_url_with_access_token( $object_id );
  4.     return $this->json_retrieve( $url );
  5. }
  6.  
  7.  
  8. // Amend it as follows
  9. function get_facebook_object( $object_id ) {
  10.     $url = $this->build_url_with_access_token( $object_id );
  11.     var_dump($url);
  12.     return $this->json_retrieve( $url );
  13. }
  14.  
  15.  
  16. // Please find this function
  17. function json_retrieve( $url ) {
  18.     add_filter( 'http_request_timeout', array( $this, 'http_request_timeout' ) );
  19.     return json_decode( wp_remote_retrieve_body( wp_remote_get( $url ) ) );
  20.     remove_filter( 'http_request_timeout', array( $this, 'http_request_timeout' ) );
  21. }
  22.  
  23.  
  24. // Amend it as follows
  25. function json_retrieve( $url ) {
  26.     add_filter( 'http_request_timeout', array( $this, 'http_request_timeout' ) );
  27.     $debug = json_decode( wp_remote_retrieve_body( wp_remote_get( $url ) ) );
  28.     print_r($debug);
  29.     return $debug;
  30.     remove_filter( 'http_request_timeout', array( $this, 'http_request_timeout' ) );
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement