Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'init', 'add_post_type_event' );
- function add_post_type_event() {
- flush_rewrite_rules( false );
- register_post_type( 'd3ms4_event',
- array(
- 'labels' => array(
- 'name' => __( 'Events' ),
- 'singular_name' => __( 'Events' ),
- 'add_new' => __( 'Add New Event' ),
- 'add_new_item' => __( 'Add New Event' ),
- 'edit_item' => __( 'Edit Event' ),
- 'new_item' => __( 'Add New Event' ),
- 'view_item' => __( 'View Event' ),
- 'search_items' => __( 'Search Event' ),
- 'not_found' => __( 'No event found' ),
- 'not_found_in_trash' => __( 'No event found in trash' )
- ),
- 'public' => true, // it's not public, it shouldn't have it's own permalink, and so on
- 'publicly_queriable' => true, // you should be able to query it
- 'show_ui' => true, // you should be able to edit it in wp-admin
- 'exclude_from_search' => true, // you should exclude it from search results
- 'show_in_nav_menus' => true, // you shouldn't be able to add it to menus
- 'has_archive' => true, // it shouldn't have archive page
- 'rewrite' => array( 'slug' => 'event' ), // it shouldn't have rewrite rules
- 'supports' => array('title', 'editor', 'thumbnail'),
- 'capability_type' => 'post',
- 'menu_icon' => 'dashicons-calendar-alt',
- 'menu_position' => 5
- )
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement