/** * Find all post */ public function findAll() { //Magazines $posts = get_posts(['post_type' => static::$associate_post_type, 'post_status' => 'publish', 'suppress_filters' => false]); //Hydrate them return Hydratator::hydrates($posts, static::$fields, static::$depth); }
/** * Find All terms and hydrate them */ public function findAll() { //Get all the terms $terms = get_terms(static::$associate_post_type, ['hide_empty' => false]); //Hydrate them all $terms = Hydratator::hydrates($terms, static::$fields, static::$depth); return $terms; }