static function get_all() { if (!isset(self::get_instance()->all_projects)) { $post_type_key = Kanban_Post_Types::format_post_type(self::$slug); $args = array('posts_per_page' => -1, 'post_type' => $post_type_key, 'post_status' => 'publish'); $posts = get_posts($args); self::get_instance()->all_projects = Kanban_Post::apply_postmeta_and_terms_to_posts($posts); } return self::get_instance()->all_projects; }
static function get_all() { if (!isset(self::get_instance()->all_tasks)) { global $wpdb; $post_type_key = Kanban_Post_Types::format_post_type(self::$slug); $sql = "SELECT *\n\t\t\t\t\tFROM `{$wpdb->prefix}posts`\n\t\t\t\t\tWHERE `{$wpdb->prefix}posts`.`post_type` = '{$post_type_key}'\n\t\t\t\t\tAND `{$wpdb->prefix}posts`.`post_status` IN ('publish')\n\t\t\t;"; $sql = apply_filters(sprintf('%s_sql_%s_get_all', Kanban::get_instance()->settings->basename, self::$slug), $sql); $posts = $wpdb->get_results($sql); self::get_instance()->all_tasks = Kanban_Post::apply_postmeta_and_terms_to_posts($posts); } return self::get_instance()->all_tasks; }