From: Steve Sutton Date: Fri, 5 Aug 2016 17:17:00 +0000 (-0400) Subject: Fixing the feed api stuff. get string not object. X-Git-Tag: v1.0.0^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=5439fff07b04af920e13a047c8babe79e7b82459;p=WP-Plugins%2Fhubspot-blog.git Fixing the feed api stuff. get string not object. Need to make sure we have the array json not the object one given to use from their site. After we store it into database go ahead and fetch it to return the results. --- diff --git a/models/GlmHubSpotBlog_Widget.php b/models/GlmHubSpotBlog_Widget.php index 37edea7..16a4c2a 100644 --- a/models/GlmHubSpotBlog_Widget.php +++ b/models/GlmHubSpotBlog_Widget.php @@ -72,11 +72,11 @@ class GlmHubSpotBlog_Widget $image_url = $this->feed_data->objects[0]->featured_image; $content = $this->feed_data->objects[0]->post_body; $url = $this->feed_data->objects[0]->published_url; - + // echo '
$this->feed_data: ' . print_r( $this->feed_data, true ) . '
'; include_once GLM_HUBSPOT_PLUGIN_DIR . '/views/frontPage.php'; } - + /** * check_for_updates @@ -135,8 +135,8 @@ class GlmHubSpotBlog_Widget return $this->wpdb->get_row( $this->wpdb->prepare( "SELECT * - FROM {$this->hubspot_table} - WHERE id = %d", + FROM {$this->hubspot_table} + WHERE id = %d", 1 ), ARRAY_A @@ -176,7 +176,7 @@ class GlmHubSpotBlog_Widget '%s' ) ); - $feed = $api_response; + $feed = $this->fetch_feed(); } return $feed; }