public function singleItemResults() { if ($this->results) { $this->results = Artmoi_Item::buildFromApi($this->results); } return $this->results; }
/** * Get the selected report or collection item image urls and * Update a post or page with them * @param $theContent * @return mixed */ public function get_the_content($theContent) { global $post; $postId = $post->ID; // the post ID in edit , not published $thumbnail = Flight::controller()->searchData($postId, "thumbnail"); $image = Flight::controller()->searchData($postId, "image"); $detail = Flight::controller()->searchData($postId, "detail"); // Format the results into an array of Artmoi_Item objects $items = array(); for ($i = 0; $i < count($detail); $i++) { $items[] = Artmoi_Item::buildFromMeta($detail[$i], $image[$i], $thumbnail[$i]); } return Flight::controller()->insertItems($postId, $theContent, $items); }