public static function get_posts($query = false, $PostClass = '\\Timber\\Post', $return_collection = false) { $posts = self::query_posts($query, $PostClass); return apply_filters('timber_post_getter_get_posts', $posts->get_posts($return_collection)); }
/** * Get posts. * @api * @example * ```php * $posts = Timber::get_posts(); * $posts = Timber::get_posts('post_type = article') * $posts = Timber::get_posts(array('post_type' => 'article', 'category_name' => 'sports')); // uses wp_query format. * $posts = Timber::get_posts('post_type=any', array('portfolio' => 'MyPortfolioClass', 'alert' => 'MyAlertClass')); //use a classmap for the $PostClass * ``` * @param mixed $query * @param string|array $PostClass * @return array|bool|null */ public static function get_posts($query = false, $PostClass = 'Timber\\Post', $return_collection = false) { return PostGetter::get_posts($query, $PostClass, $return_collection); }