Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*********************************************************************************************
- *********************************************************************************************
- Fruit Post Type
- *********************************************************************************************
- *********************************************************************************************/
- add_action('init', 'create_fruit_PDDCPT');
- function create_fruit_pddcpt() {
- register_post_type( 'fruit',
- array(
- 'labels' => array(
- 'name' => __( 'fruit', '' ),
- 'singular_name' => __( 'Item', '' ),
- 'add_new' => __( 'Add New Item', '' ),
- 'add_new_item' => __( 'Add New Item', '' ),
- 'edit_item' => __( 'Edit Item', '' ),
- 'new_item' => __( 'Add New Item', '' ),
- 'view_item' => __( 'View Item', '' ),
- 'search_items' => __( 'Search', '' ),
- 'not_found' => __( 'No items found', '' ),
- 'not_found_in_trash' => __( 'No items found in trash', '' ) ),
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'query_var' => true,
- 'permalink_epmask' => true,
- 'show_admin_column' => true,
- 'menu_position' => 10,
- 'show_in_menu' => true,
- 'supports' => array( 'title', 'editor', 'comments', 'page-attributes', 'thumbnail' ),
- 'taxonomies' => array( 'post_tag'),
- 'rewrite' => true,
- 'has_archive' => true ));
- }
- add_action( 'init', 'create_fruit_taxonomies', 0 );
- function create_fruit_taxonomies() {
- $labels = array(
- 'name' => __( 'Fruit Categories', '' ),
- 'singular_name' => __( 'Fruit Category', '' ),
- 'search_items' => __( 'Search', '' ),
- 'popular_items' => __( 'Popular Categories', '' ),
- 'all_items' => __( 'All Categories', '' ),
- 'parent_item' => __( 'Parent Category', '' ),
- 'parent_item_colon' => __( 'Parent Category:' ),
- 'edit_item' => __( 'Edit Category', '' ),
- 'update_item' => __( 'Update Category', '' ),
- 'add_new_item' => __( 'Add Category', '' ),
- 'new_item_name' => __( 'New Category', '' ),
- 'choose_from_most_used' => __( 'Choose from most used Types', '' ),
- 'menu_name' => __( 'Fruit Categories' ),
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'hierarchical' => true,
- 'show_ui' => true,
- 'show_in_nav_menus' => true,
- 'args' => array( 'orderby' => 'term_order' ),
- 'rewrite' => array( 'slug' => 'wine-dine', 'with_front' => false ),
- 'show_admin_column' => true,
- 'query_var' => true
- );
- register_taxonomy( 'fruit_categories', array( 'fruit' ), $args );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement