Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

my custom columns code

By: a guest on Sep 6th, 2010  |  syntax: PHP  |  size: 5.49 KB  |  hits: 128  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Custom Post Types Appearance
  2.  
  3.  
  4. // Custom Post Type: Sermon Media: Appearance
  5. add_action('manage_posts_custom_column', 'sermonaudio_custom_columns');
  6. add_filter("manage_edit-sermonaudio_columns", "sermonaudio_edit_columns");  
  7. function sermonaudio_edit_columns($columns){  
  8.         $columns = array(  
  9.             "cb" => "<input type=\"checkbox\" />",  
  10.             "title" => "Sermon Title",  
  11.             "date" => "Date Published",  
  12.             "description" => "Sermon Description",  
  13.             "speaker" => "Speaker",  
  14.             "series" => "Sermon Series",  
  15.             "season" => "Season",  
  16.             "topic" => "Topics",  
  17.         );  
  18.  
  19.         return $columns;  
  20. }  
  21.  
  22. function sermonaudio_custom_columns($column){  
  23.         global $post;  
  24.         switch ($column)  
  25.         {  
  26.             case "description":  
  27.                 the_excerpt();  
  28.                 break;  
  29.             case "season":  
  30.                 echo get_the_term_list($post->ID, 'season', '', ', ','');  
  31.                 break;  
  32.             case "topic":  
  33.                 echo get_the_term_list($post->ID, 'topic', '', ', ','');  
  34.                 break;  
  35.             case "series":  
  36.                 echo get_the_term_list($post->ID, 'series', '', ', ','');  
  37.                 break;  
  38.             case "speaker":  
  39.                 echo get_the_term_list($post->ID, 'speaker', '', ', ','');  
  40.                 break;  
  41.         }  
  42. }  
  43.  
  44. // Custom Post Type: Staff: Appearance
  45. add_action('manage_pages_custom_column', 'staff_custom_columns');
  46. add_filter("manage_edit-staff_columns", "staff_edit_columns");  
  47.  
  48. function staff_edit_columns($columns){  
  49.         $columns = array(  
  50.             "cb" => "<input type=\"checkbox\" />",  
  51.             "title" => "Staff Member Name",  
  52.                         "thumbnail" => "Picture",
  53.             "position" => "Staff Position",  
  54.             "books" => "Favorite Books",  
  55.             "movies" => "Favorite Movies",  
  56.             "artists" => "Favorite Music Artists",
  57.             "foods" => "Favorite Foods",  
  58.             "activities" => "Favorite Activities",  
  59.             "verses" => "Favorite Verses",  
  60.             "favorite-things" => "Other Favorite Things",
  61.         );  
  62.  
  63.         return $columns;  
  64. }  
  65.  
  66. function staff_custom_columns($column){  
  67.         global $post;  
  68.         switch ($column)  
  69.         {  
  70.             case "position":  
  71.                 echo get_the_term_list($post->ID, 'position', '', ', ','');  
  72.                 break;  
  73.             case "books":  
  74.                 echo get_the_term_list($post->ID, 'books', '', ', ','');  
  75.                 break;  
  76.             case "movies":  
  77.                 echo get_the_term_list($post->ID, 'movies', '', ', ','');  
  78.                 break;  
  79.             case "artists":  
  80.                 echo get_the_term_list($post->ID, 'artists', '', ', ','');  
  81.                 break;  
  82.             case "foods":  
  83.                 echo get_the_term_list($post->ID, 'foods', '', ', ','');  
  84.                 break;  
  85.             case "activities":  
  86.                 echo get_the_term_list($post->ID, 'activities', '', ', ','');  
  87.                 break;  
  88.             case "verses":  
  89.                 echo get_the_term_list($post->ID, 'verses', '', ', ','');  
  90.                 break;  
  91.             case "favorite-things":  
  92.                 echo get_the_term_list($post->ID, 'favorite-things', '', ', ','');  
  93.                 break;  
  94.                         case "thumbnail":
  95.                                 the_post_thumbnail();
  96.         }  
  97. }  
  98.  
  99.  
  100. // Custom Post Type: Front Page Large Featured Items: Appearance
  101. add_action('manage_posts_custom_column', 'ww_custom_columns');
  102. add_filter("manage_edit-ww_columns", "ww_edit_columns");  
  103.  
  104. function ww_edit_columns($columns){  
  105.         $columns = array(  
  106.             "cb" => "<input type=\"checkbox\" />",
  107.             "title" => "Featured Item Name",
  108.             "date" => "Date Published",
  109.             "description" => "Featured Item Description",
  110.             "ministry" => "Ministry Category",
  111.                         "thumbnail" => "Thumbnail"
  112.         );  
  113.  
  114.         return $columns;  
  115.                 }  
  116. function ww_custom_columns($column){  
  117.         global $post;  
  118.         switch ($column)  
  119.         {  
  120.             case "description":  
  121.                 the_excerpt();  
  122.                 break;  
  123.             case "ministry":  
  124.                 echo get_the_term_list($post->ID, 'ministry', '', ', ','');  
  125.                 break;  
  126.                         case "thumbnail":
  127.                                 the_post_thumbnail();
  128.         }  
  129.         }  
  130.  
  131.  
  132. // Custom Post Type: Front Page Small Featured Items: Appearance
  133. add_action('manage_posts_custom_column', 'featured_custom_columns');
  134. add_filter("manage_edit-featured_columns", "featured_edit_columns");  
  135.  
  136. function featured_edit_columns($columns){  
  137.         $columns = array(  
  138.             "cb" => "<input type=\"checkbox\" />",  
  139.             "title" => "Featured Item Name",  
  140.             "date" => "Date Published",  
  141.             "description" => "Featured Item Excerpt",  
  142.             "ministry" => "Ministry Category",  
  143.                         "thumbnail" => "Thumbnail"
  144.         );  
  145.  
  146.         return $columns;  
  147.                 }  
  148.  
  149. function featured_custom_columns($column){  
  150.         global $post;  
  151.         switch ($column)  
  152.                 {  
  153.             case "description":  
  154.                 the_excerpt();  
  155.                 break;  
  156.             case "ministry":  
  157.                 echo get_the_term_list($post->ID, 'ministry', '', ', ','');  
  158.                 break;  
  159.                         case "thumbnail":
  160.                                 the_post_thumbnail();
  161.                 }  
  162.                 }