コード例 #1
0
ファイル: index.php プロジェクト: abdullaniyas/cleansweep2
 /**
  * retrieves the terms in a taxonomy or list of taxonomies.
  */
 function atp_variable($type)
 {
     $iva_of_options = parent::atp_variable($type);
     switch ($type) {
         /**
          * get posts id and name  
          */
         case 'offers':
             // Get offers Name/Id
             $args = array('posts_per_page' => -1, 'offset' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'offers', 'post_status' => 'publish', 'suppress_filters' => true);
             $atp_entries = get_posts($args);
             foreach ($atp_entries as $key => $entry) {
                 $iva_of_options[$entry->ID] = $entry->post_title;
             }
             break;
     }
     return $iva_of_options;
 }
コード例 #2
0
ファイル: index.php プロジェクト: pryspry/MusicPlay
 function atp_variable($type)
 {
     $iva_options = parent::atp_variable($type);
     switch ($type) {
         case 'artists':
             // Get Artists Name/Slug
             $args = array('posts_per_page' => -1, 'offset' => 0, 'category' => '', 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'artists', 'post_mime_type' => '', 'post_parent' => '', 'post_status' => 'publish', 'suppress_filters' => true);
             $atp_entries = get_posts($args);
             foreach ($atp_entries as $key => $entry) {
                 $iva_options[$entry->ID] = $entry->post_title;
             }
             break;
         case 'album':
             // Get album Slug and Name
             $atp_entries = get_terms('genres', 'orderby=name&hide_empty=0');
             foreach ($atp_entries as $atpalbum) {
                 $iva_options[$atpalbum->slug] = $atpalbum->name;
                 $album_ids[] = $atpalbum->slug;
             }
             break;
         case 'album_label':
             // Get album Slug and Name
             $atp_entries = get_terms('label', 'orderby=name&hide_empty=0');
             foreach ($atp_entries as $atpalbum) {
                 $iva_options[$atpalbum->slug] = $atpalbum->name;
                 $album_ids[] = $atpalbum->slug;
             }
             break;
         case 'album_genres':
             // Get album Slug and Name
             $atp_entries = get_terms('genres', 'orderby=name&hide_empty=0');
             foreach ($atp_entries as $atpalbum) {
                 $iva_options[$atpalbum->slug] = $atpalbum->name;
                 $album_ids[] = $atpalbum->slug;
             }
             break;
         case 'gallery':
             // Get Gallery Slug and Name
             $atp_entries = get_terms('gallery_type', 'orderby=name&hide_empty=0');
             foreach ($atp_entries as $atpalbum) {
                 $iva_options[$atpalbum->slug] = $atpalbum->name;
                 $album_ids[] = $atpalbum->slug;
             }
             break;
         case 'video':
             // Get Gallery Slug and Name
             $atp_entries = get_terms('video_type', 'orderby=name&hide_empty=0');
             foreach ($atp_entries as $atpvideo) {
                 $iva_options[$atpvideo->slug] = $atpvideo->name;
                 $video_ids[] = $atpvideo->slug;
             }
             break;
         case 'artist_cat':
             // Get Events Slug and Name
             $atp_entries = get_terms('artist_cat', 'orderby=name&hide_empty=0');
             if (is_array($atp_entries)) {
                 foreach ($atp_entries as $atpArtist) {
                     $iva_options[$atpArtist->slug] = $atpArtist->name;
                     $artist[] = $atpArtist->slug;
                 }
             }
             break;
         case 'djmix':
             // Get Slider Slug and Name
             $atp_entries = get_terms('djmix_cat', 'orderby=name&hide_empty=0');
             foreach ($atp_entries as $atpDjmix) {
                 $iva_options[$atpDjmix->slug] = $atpDjmix->name;
                 $djmix_ids[] = $atpDjmix->slug;
             }
             break;
     }
     return $iva_options;
 }