cpt_event
// Register Custom Post Type
function cpt_event() {
$labels = array(
'name' => _x( 'Events', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Event', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Events', 'text_domain' ),
'name_admin_bar' => __( 'Events', 'text_domain' ),
'archives' => __( 'Event Archiv', 'text_domain' ),
'attributes' => __( 'Event Attribute', 'text_domain' ),
'parent_item_colon' => __( 'Eltern Event', 'text_domain' ),
'all_items' => __( 'Alle Events', 'text_domain' ),
'add_new_item' => __( 'Neues Event hinzufügen', 'text_domain' ),
'add_new' => __( 'Neues hinzufügen', 'text_domain' ),
'new_item' => __( 'Neues Event', 'text_domain' ),
'edit_item' => __( 'Event bearbeiten', 'text_domain' ),
'update_item' => __( 'Event updaten', 'text_domain' ),
'view_item' => __( 'Event anzeigen', 'text_domain' ),
'view_items' => __( 'Events anzeigen', 'text_domain' ),
'search_items' => __( 'Event suchen', 'text_domain' ),
'not_found' => __( 'Nicht gefunden', 'text_domain' ),
'not_found_in_trash' => __( 'Nicht im Papierkorb gefunden', 'text_domain' ),
'featured_image' => __( 'Beitragsbild', 'text_domain' ),
'set_featured_image' => __( 'Beitragsbild festlegen', 'text_domain' ),
'remove_featured_image' => __( 'Beitragsbild entfernen', 'text_domain' ),
'use_featured_image' => __( 'Beitragsbild nutzen', 'text_domain' ),
'insert_into_item' => __( 'In Event einfügen', 'text_domain' ),
'uploaded_to_this_item' => __( 'Zu Event hochladen', 'text_domain' ),
'items_list' => __( 'Eventliste', 'text_domain' ),
'items_list_navigation' => __( 'Eventlistennavigation', 'text_domain' ),
'filter_items_list' => __( 'Eventlistenfilter', 'text_domain' ),
);
$args = array(
'label' => __( 'Event', 'text_domain' ),
'description' => __( 'Post Type Description', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' ),
'taxonomies' => array( 'category', 'event_tag' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-calendar',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'pt_event', $args );
}
add_action( 'init', 'cpt_event', 0 );