Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'init', 'register_cpt_travel' );
- function register_cpt_travel() {
- $labels = array(
- 'name' => _x( 'travels', 'travel' ),
- 'singular_name' => _x( 'travel', 'travel' ),
- 'add_new' => _x( 'Add New', 'travel' ),
- 'add_new_item' => _x( 'Add New travel', 'travel' ),
- 'edit_item' => _x( 'Edit travel', 'travel' ),
- 'new_item' => _x( 'New travel', 'travel' ),
- 'view_item' => _x( 'View travel', 'travel' ),
- 'search_items' => _x( 'Search travels', 'travel' ),
- 'not_found' => _x( 'No travels found', 'travel' ),
- 'not_found_in_trash' => _x( 'No travels found in Trash', 'travel' ),
- 'parent_item_colon' => _x( 'Parent travel:', 'travel' ),
- 'menu_name' => _x( 'travels', 'travel' ),
- );
- $args = array(
- 'labels' => $labels,
- 'hierarchical' => false,
- 'supports' => array( 'title', 'editor' ),
- 'taxonomies' => array( 'type', 'place', 'level' ),
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 5,
- 'show_in_nav_menus' => true,
- 'publicly_queryable' => true,
- 'exclude_from_search' => false,
- 'has_archive' => true,
- 'query_var' => true,
- 'can_export' => true,
- 'rewrite' => true,
- 'capability_type' => 'post'
- );
- register_post_type( 'travel', $args );
- }
- add_action( 'init', 'register_taxonomy_level' );
- function register_taxonomy_level() {
- $labels = array(
- 'name' => _x( 'Level', 'levels' ),
- 'singular_name' => _x( 'Levels', 'levels' ),
- 'search_items' => _x( 'Search Level', 'levels' ),
- 'popular_items' => _x( 'Popular Level', 'levels' ),
- 'all_items' => _x( 'All Level', 'levels' ),
- 'parent_item' => _x( 'Parent Levels', 'levels' ),
- 'parent_item_colon' => _x( 'Parent Levels:', 'levels' ),
- 'edit_item' => _x( 'Edit Levels', 'levels' ),
- 'update_item' => _x( 'Update Levels', 'levels' ),
- 'add_new_item' => _x( 'Add New Levels', 'levels' ),
- 'new_item_name' => _x( 'New Levels Name', 'levels' ),
- 'separate_items_with_commas' => _x( 'Separate level with commas', 'levels' ),
- 'add_or_remove_items' => _x( 'Add or remove level', 'levels' ),
- 'choose_from_most_used' => _x( 'Choose from the most used level', 'levels' ),
- 'menu_name' => _x( 'Level', 'levels' ),
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'show_in_nav_menus' => true,
- 'show_ui' => true,
- 'show_tagcloud' => true,
- 'hierarchical' => true,
- 'rewrite' => true,
- 'query_var' => true
- );
- register_taxonomy( 'level', array('travel'), $args );
- }
- add_action( 'init', 'register_taxonomy_place' );
- function register_taxonomy_place() {
- $places = array(
- 'name' => _x( 'places', 'places' ),
- 'singular_name' => _x( 'places', 'places' ),
- 'search_items' => _x( 'Search place', 'places' ),
- 'popular_items' => _x( 'Popular place', 'places' ),
- 'all_items' => _x( 'All place', 'places' ),
- 'parent_item' => _x( 'Parent places', 'places' ),
- 'parent_item_colon' => _x( 'Parent places:', 'places' ),
- 'edit_item' => _x( 'Edit places', 'places' ),
- 'update_item' => _x( 'Update places', 'places' ),
- 'add_new_item' => _x( 'Add New places', 'places' ),
- 'new_item_name' => _x( 'New places Name', 'places' ),
- 'separate_items_with_commas' => _x( 'Separate place with commas', 'places' ),
- 'add_or_remove_items' => _x( 'Add or remove place', 'places' ),
- 'choose_from_most_used' => _x( 'Choose from the most used place', 'places' ),
- 'menu_name' => _x( 'place', 'places' ),
- );
- $args = array(
- 'places' => $places,
- 'public' => true,
- 'show_in_nav_menus' => true,
- 'show_ui' => true,
- 'show_tagcloud' => true,
- 'hierarchical' => true,
- 'rewrite' => true,
- 'query_var' => true
- );
- register_taxonomy( 'place', array('travel'), $args );
- }
- add_action( 'init', 'register_taxonomy_type' );
- function register_taxonomy_type() {
- $labels = array(
- 'name' => _x( 'type', 'types' ),
- 'singular_name' => _x( 'types', 'types' ),
- 'search_items' => _x( 'Search type', 'types' ),
- 'popular_items' => _x( 'Popular type', 'types' ),
- 'all_items' => _x( 'All type', 'types' ),
- 'parent_item' => _x( 'Parent types', 'types' ),
- 'parent_item_colon' => _x( 'Parent types:', 'types' ),
- 'edit_item' => _x( 'Edit types', 'types' ),
- 'update_item' => _x( 'Update types', 'types' ),
- 'add_new_item' => _x( 'Add New types', 'types' ),
- 'new_item_name' => _x( 'New types Name', 'types' ),
- 'separate_items_with_commas' => _x( 'Separate type with commas', 'types' ),
- 'add_or_remove_items' => _x( 'Add or remove type', 'types' ),
- 'choose_from_most_used' => _x( 'Choose from the most used type', 'types' ),
- 'menu_name' => _x( 'type', 'types' ),
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'show_in_nav_menus' => true,
- 'show_ui' => true,
- 'show_tagcloud' => true,
- 'hierarchical' => true,
- 'rewrite' => true,
- 'query_var' => true
- );
- register_taxonomy( 'type', array('travel'), $args );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement