public function __construct() { $intro = new JSON_API_Application_Data_Intro_Spector(); $intro->set_value($this, "posts", new JSON_API_Application_Posts_Model(array())); $intro->set_value($this, "post_content", $this->get_home_page_content()); return $this; }
public function __construct($product_id, $quantity) { $intro = new JSON_API_Application_Data_Intro_Spector(); $intro->set_value($this, "productId", $product_id); $intro->set_value($this, "quantity", $quantity); $this->validate_add_to_cart_data($intro); }
public function __construct($wp_comment = null) { if ($wp_comment) { $intro = new JSON_API_Application_Data_Intro_Spector(); $intro->set_value($this, "id", $wp_comment->comment_ID); $intro->set_value($this, "name", $wp_comment->comment_author); $intro->set_value($this, "date", $intro->formatted_date($wp_comment->comment_date)); $intro->set_value($this, "content", apply_filters("comment_text", $wp_comment->comment_content)); $intro->set_value($this, "avatar", $intro->get_avatar_url($wp_comment->comment_ID, 30)); } return $this; }
private function query_comments($postID) { $intro = new JSON_API_Application_Data_Intro_Spector(); $wp_comments = $intro->comments_filter_query($postID); $comments = array(); foreach ($wp_comments as $wp_comment) { array_push($comments, new JSON_API_Application_Comment_Model($wp_comment)); } $intro->set_value($this, "comments", $comments); }
function query_posts($query = false) { global $wp_query, $post, $json_api, $json_api_application; $intro = new JSON_API_Application_Data_Intro_Spector(); extract($json_api->query->get(array("id", "slug", "post_id", "post_slug"))); $query = array("p" => $id); $query = array_merge($query, $wp_query->query); if (!empty($query)) { query_posts($query); } while (have_posts()) { the_post(); } $intro->set_value($this, "post", new JSON_API_Application_Post_Details_Model($post)); //$this->query_comments( $post->ID, $intro ); $this->query_previous_next_links($intro); }