Advertisement
Guest User

Untitled

a guest
Jul 13th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. $labels = array(
  2. 'name' => _x( 'Product Categories', 'taxonomy general name' ),
  3. 'singular_name' => __( 'Product Category', 'taxonomy singular name' ),
  4. 'search_items' => __( 'Search Categories' ),
  5. 'all_items' => __( 'All Categories' ),
  6. 'edit_item' => __( 'Edit Category' ),
  7. 'update_item' => __( 'Update Category' ),
  8. 'add_new_item' => __( 'Add New Category' ),
  9. 'new_item_name' => __( 'New Category' ),
  10. 'menu_name' => __( 'Product Categories' ),
  11. );
  12.  
  13. register_taxonomy('product_categories', array('products'), array(
  14. 'hierarchical' => true,
  15. 'labels' => $labels,
  16. 'query_var' => true,
  17. 'rewrite' => array('slug' => '', 'with_front' => false)
  18. ));
  19.  
  20. add_action('init', 'products');
  21. function products()
  22. {
  23. $labels = array(
  24. 'name' => _x('Products', 'post type general name'),
  25. 'singular_name' => _x('Product', 'post type singular name'),
  26. 'add_new' => _x('Add New', 'products'),
  27. 'add_new_item' => __('Add New Product'),
  28. 'edit_item' => __('Edit Product'),
  29. 'new_item' => __('New Product'),
  30. 'view_item' => __('View Product'),
  31. 'search_items' => __('Search Products'),
  32. 'not_found' => __('No products found'),
  33. 'not_found_in_trash' => __('No products found in Trash'),
  34. 'parent_item_colon' => ''
  35. );
  36. $args = array(
  37. 'labels' => $labels,
  38. 'public' => true,
  39. 'publicly_queryable' => true,
  40. 'exclude_from_search' => false,
  41. 'show_ui' => true,
  42. 'query_var' => true,
  43. 'capability_type' => 'post',
  44. 'taxonomies' => array('product_categories'),
  45. 'hierarchical' => false,
  46. 'has_archive' => 'products',
  47. 'can_export' => true,
  48. 'supports' => array('title', 'thumbnail', 'page-attributes', 'editor', 'excerpt'),
  49. 'rewrite' => array('slug' => '', 'with_front' => false)
  50. );
  51. register_post_type('products',$args);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement