You are here

public function ShareaholicShareCount::has_http_error in Share Buttons, Related Posts, Content Analytics - Shareaholic 8

Same name and namespace in other branches
  1. 7.3 lib/social-share-counts/share_count.php \ShareaholicShareCount::has_http_error()

Check if calling the service returned any type of error

Parameters

object $response A response object:

Return value

bool true if it has an error or false if it does not

9 calls to ShareaholicShareCount::has_http_error()
ShareaholicShareCount::buffer_count_callback in lib/social-share-counts/share_count.php
Callback function for buffer count API Gets the buffer share counts from response
ShareaholicShareCount::facebook_count_callback in lib/social-share-counts/share_count.php
Callback function for facebook count API Gets the facebook counts from response
ShareaholicShareCount::fancy_count_callback in lib/social-share-counts/share_count.php
Callback function for Fancy count API Gets the Fancy counts from response
ShareaholicShareCount::odnoklassniki_count_callback in lib/social-share-counts/share_count.php
Callback function for odnoklassniki count API Gets the odnoklassniki counts from response
ShareaholicShareCount::pinterest_count_callback in lib/social-share-counts/share_count.php
Callback function for pinterest count API Gets the pinterest counts from response

... See full list

File

lib/social-share-counts/share_count.php, line 116

Class

ShareaholicShareCount
An abstract class Share Counts to be extended

Code

public function has_http_error($response) {
  if (!$response || !isset($response['response']['code']) || !preg_match('/20*/', $response['response']['code']) || !isset($response['body'])) {
    return true;
  }
  return false;
}