Event Post Type
// Register Custom Post Type
function event() {
$labels = array(
'name' => _x( 'Events', 'Post Type General Name', 'ufo' ),
'singular_name' => _x( 'Event', 'Post Type Singular Name', 'ufo' ),
'menu_name' => __( 'Event', 'ufo' ),
'parent_item_colon' => __( 'Parent Event:', 'ufo' ),
'all_items' => __( 'All Events', 'ufo' ),
'view_item' => __( 'View Event', 'ufo' ),
'add_new_item' => __( 'Add New Event', 'ufo' ),
'add_new' => __( 'Add New', 'ufo' ),
'edit_item' => __( 'Edit Event', 'ufo' ),
'update_item' => __( 'Update Event', 'ufo' ),
'search_items' => __( 'Search Event', 'ufo' ),
'not_found' => __( 'Not found', 'ufo' ),
'not_found_in_trash' => __( 'Not found in Trash', 'ufo' ),
);
$args = array(
'label' => __( 'event', 'ufo' ),
'description' => __( 'Event Content Type', 'ufo' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'revisions', ),
'taxonomies' => array( 'category', 'post_tag', 'subscription_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-page',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'event', $args );
}
// Hook into the 'init' action
add_action( 'init', 'event', 0 );