Example #1
0
 public function getPrograms()
 {
     if (!$this->init) {
         return FALSE;
     }
     $categories = (array) Arr::get($this->options->category_options, 'categories');
     if (empty($categories)) {
         return FALSE;
     }
     $posts = get_posts(array('category__in' => $categories, 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'desc'));
     $programs_array = array();
     foreach ($posts as &$post) {
         if (empty($post->post_title)) {
             continue;
         }
         $program_title = $post->post_title;
         $program_title = trim($program_title);
         $program_title = strip_tags($program_title);
         $program_title = htmlspecialchars($program_title, ENT_QUOTES);
         $program_title = preg_replace('#\\&\\w{3,7};#iu', '', $program_title);
         $program_title = Model::cleanName($program_title);
         $programs_array[] = $program_title;
     }
     return $programs_array;
 }