Function Reference: gdfi_get_fb_owner

Summary

This function has not been documented yet.

Source Code

function gdfi_get_fb_owner($page_id)
{
    global $wpdb;
    $gdfi_config = get_option('gdfi_config');
    $url = 'https://graph.facebook.com/v2.4/' . $page_id . '?metadata=1&access_token=' . $gdfi_config['access_token'];

    $result = wp_remote_get($url, array('timeout' => 15));

    $result_arr = json_decode($result['body']);
    if ($result_arr) {
        if (!empty($result_arr->location)) {
            unset($result_arr->location);
        }
        if (!empty($result_arr->name)) {
            unset($result_arr->name);
        }
        if (!empty($result_arr->description)) {
            unset($result_arr->description);
        }
        return $result_arr;
    }
}