bohdangorovoy
1/15/2016 - 11:12 PM

WP: Custom post type

WP: Custom post type

/**
 * Register custom post type
 */


function custom_post_type() {
    $labels = array(
        'name' => '',
        'singular_name' => '',
        'add_new' => '',
        'add_new_item' => '',
        'edit_item' => '',
        'new_item' => '',
        'search_item' => '',
        'not_found' => '',
        'not_found_in_trash' => '',
        'menu_name' => ''
    );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'show_ui' => true,
        'has_archive' => true,
        'menu_icon' => '',
        'menu_position' => 5,
        'taxonomies' => array(),
        'supports' => array()
    );

    register_post_type('new_post_type', $args);
}

add_action( 'init', 'custom_post_type' );