Fixing the feed api stuff. get string not object.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 5 Aug 2016 17:17:00 +0000 (13:17 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 5 Aug 2016 17:17:00 +0000 (13:17 -0400)
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

index 37edea7..16a4c2a 100644 (file)
@@ -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 '<pre>$this->feed_data: ' . print_r( $this->feed_data, true ) . '</pre>';
         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;
     }