Jake Vanderwerf
2026-01-19 0113d2e9c9ff34a6ffb10707cc76d34b67a0c367
inc/rest/routes/ContentRoutes.php
@@ -1,4 +1,5 @@
<?php
namespace JVBase\rest\routes;
use JVBase\JVB;
@@ -95,6 +96,7 @@
      $this->timelineUniqueFields = $this->getTimelineUniqueFields($content);
   }
   public function getTimelineUniqueFields(string $content):array
   {
      $content = jvbNoBase($content);
@@ -144,11 +146,17 @@
      error_log('Received data: '.print_r($data, true));
        $user_id = $data['user'];
        if (!isset($data['posts']) || !is_array($data['posts'])) {
      if (!$this->userCheck($user_id)) {
            return new WP_REST_Response([
                'success'   => false,
                'message'   =>'Invalid request format'
            'success' => true,
            'message' => 'You for real?'
         ]);
      }
      if (!array_key_exists('posts', $data) || !is_array($data['posts'])) {
         return new WP_REST_Response([
            'success' => true,
            'message' => 'No posts found'
            ]);
        }
@@ -896,7 +904,7 @@
    }
    /**
     * @param WP_Post $post the wordpress post object
    * @param WP_Post $post the post object
     *
     * @return array
     */
@@ -945,6 +953,7 @@
        return $data;
    }
   protected function extractImages(array $fields = []):array
   {
      //Extract images
@@ -995,6 +1004,7 @@
      $item['fields']['timeline'] = $subFields;
      $item['images'] = $item['images'] + $images;
      return $item;
   }