whyisjake

Jake Spurlock

Nov 8th, 2010
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. add_filter("manage_edit-the_store_columns", "prod_edit_columns");
  2. add_action("manage_posts_custom_column",  "prod_custom_columns");
  3.  
  4. function prod_edit_columns($columns){
  5.         $columns = array(
  6.             "cb" => "<input type=\"checkbox\" />",
  7.             "title" => "Product Title",
  8.             "description" => "Description",
  9.             "price" => "Price",
  10.             "catalog" => "Catalog",
  11.             "display" => "Display",
  12.         );
  13.  
  14.         return $columns;
  15. }
  16.  
  17. function prod_custom_columns($column){
  18.         global $post;
  19.         switch ($column)
  20.         {
  21.             case "description":
  22.                 the_excerpt();
  23.                 break;
  24.             case "price":
  25.                 $custom = get_post_custom();
  26.                 echo $custom["thestore_price"][0];
  27.                 break;
  28.             case "catalog":
  29.                 echo wp_tag_cloud( array( 'taxonomy' => 'Product Tags', format => 'flat' ) );
  30.                 break;
  31.             case "display":
  32.                 $custom_display = get_post_custom();
  33.                 echo $custom_display["thestore_display"][0];
  34.                 break;
  35.         }
  36. }
Add Comment
Please, Sign In to add comment