From 5439fff07b04af920e13a047c8babe79e7b82459 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 5 Aug 2016 13:17:00 -0400 Subject: [PATCH] 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. --- models/GlmHubSpotBlog_Widget.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.17.1