tour cpt
if ( ! function_exists('tours_type') ) {
// Register Custom Post Type
function tours_type() {
$labels = array(
'name' => _x( 'Tours', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Tour', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Tours', 'text_domain' ),
'name_admin_bar' => __( 'Tours', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
'all_items' => __( 'All Items', 'text_domain' ),
'add_new_item' => __( 'Add New Tour', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'new_item' => __( 'New Tour', 'text_domain' ),
'edit_item' => __( 'Edit Tour', 'text_domain' ),
'update_item' => __( 'Update Tour', 'text_domain' ),
'view_item' => __( 'View Tour', 'text_domain' ),
'search_items' => __( 'Search Tours', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
);
$capabilities = array(
'edit_post' => 'edit_tour',
'read_post' => 'read_tour',
'delete_post' => 'delete_tour',
'edit_posts' => 'edit_tours',
'edit_others_posts' => 'edit_others_tours',
'publish_posts' => 'publish_tours',
'read_private_posts' => 'read_private_tour',
);
$args = array(
'label' => __( 'Tour', 'text_domain' ),
'description' => __( 'Raftrek Tours', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', ),
'taxonomies' => array( 'activities', 'level' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 20,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capabilities' => $capabilities,
);
register_post_type( 'tour_type', $args );
}
add_action( 'init', 'tours_type', 0 );
}