Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jo-snips/5602670 to your computer and use it in GitHub Desktop.
Save jo-snips/5602670 to your computer and use it in GitHub Desktop.
<?php
// use this method to replace the orininal in v1.0.5 (line 273 in the-events-calendar-facebook-importer.php)
function get_facebook_photo( $object_id ) {
$api_url = $this->build_url_with_access_token( $object_id . '/', array( 'fields' => 'cover', 'return_ssl_resources' => 1 ) );
$api_request = $this->json_retrieve( $api_url );
$new_path = $api_request->cover->source;
$get_photo = wp_remote_get( $api_request->cover->source );
// setup return object
$photo['url'] = $new_path;
$photo['source'] = $get_photo['body'];
return apply_filters( 'tribe_fb_get_facebook_photo', $photo, $api_url, $api_request );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment