Advertisement
Guest User

Untitled

a guest
Jun 18th, 2013
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. /*********************************************************************************************
  2. *********************************************************************************************
  3.  
  4. Fruit Post Type
  5.  
  6. *********************************************************************************************
  7. *********************************************************************************************/
  8. add_action('init', 'create_fruit_PDDCPT');
  9. function create_fruit_pddcpt() {
  10.  
  11. register_post_type( 'fruit',
  12. array(
  13. 'labels' => array(
  14. 'name' => __( 'fruit', '' ),
  15. 'singular_name' => __( 'Item', '' ),
  16. 'add_new' => __( 'Add New Item', '' ),
  17. 'add_new_item' => __( 'Add New Item', '' ),
  18. 'edit_item' => __( 'Edit Item', '' ),
  19. 'new_item' => __( 'Add New Item', '' ),
  20. 'view_item' => __( 'View Item', '' ),
  21. 'search_items' => __( 'Search', '' ),
  22. 'not_found' => __( 'No items found', '' ),
  23. 'not_found_in_trash' => __( 'No items found in trash', '' ) ),
  24. 'public' => true,
  25. 'publicly_queryable' => true,
  26. 'show_ui' => true,
  27. 'query_var' => true,
  28. 'permalink_epmask' => true,
  29. 'show_admin_column' => true,
  30. 'menu_position' => 10,
  31. 'show_in_menu' => true,
  32. 'supports' => array( 'title', 'editor', 'comments', 'page-attributes', 'thumbnail' ),
  33. 'taxonomies' => array( 'post_tag'),
  34. 'rewrite' => true,
  35. 'has_archive' => true ));
  36. }
  37.  
  38. add_action( 'init', 'create_fruit_taxonomies', 0 );
  39. function create_fruit_taxonomies() {
  40. $labels = array(
  41. 'name' => __( 'Fruit Categories', '' ),
  42. 'singular_name' => __( 'Fruit Category', '' ),
  43. 'search_items' => __( 'Search', '' ),
  44. 'popular_items' => __( 'Popular Categories', '' ),
  45. 'all_items' => __( 'All Categories', '' ),
  46. 'parent_item' => __( 'Parent Category', '' ),
  47. 'parent_item_colon' => __( 'Parent Category:' ),
  48. 'edit_item' => __( 'Edit Category', '' ),
  49. 'update_item' => __( 'Update Category', '' ),
  50. 'add_new_item' => __( 'Add Category', '' ),
  51. 'new_item_name' => __( 'New Category', '' ),
  52. 'choose_from_most_used' => __( 'Choose from most used Types', '' ),
  53. 'menu_name' => __( 'Fruit Categories' ),
  54. );
  55.  
  56. $args = array(
  57. 'labels' => $labels,
  58. 'public' => true,
  59. 'hierarchical' => true,
  60. 'show_ui' => true,
  61. 'show_in_nav_menus' => true,
  62. 'args' => array( 'orderby' => 'term_order' ),
  63. 'rewrite' => array( 'slug' => 'wine-dine', 'with_front' => false ),
  64. 'show_admin_column' => true,
  65. 'query_var' => true
  66. );
  67. register_taxonomy( 'fruit_categories', array( 'fruit' ), $args );
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement