I have a theme on WordPress 4.4 which has this file included in functions.php
:
<?php
function post_types(){
$labels = array(
'name' => __( 'Newsletters'),
'singular_name' => __( 'Newsletter'),
'menu_name' => __( 'Newsletters'),
'name_admin_bar' => __( 'Newsletter'),
'add_new' => __( 'Add New'),
'add_new_item' => __( 'Add New Newsletter'),
'new_item' => __( 'New Newsletter'),
'edit_item' => __( 'Edit Newsletter'),
'view_item' => __( 'View Newsletter'),
'all_items' => __( 'All Newsletters'),
'search_items' => __( 'Search Newsletters'),
'parent_item_colon' => __( 'Parent Newsletters'),
'not_found' => __( 'No Newsletters found.'),
'not_found_in_trash' => __( 'No Newsletters found in Trash.')
);
$args = array(
'labels' => $labels,
'public' => true,
'show_in_menu' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'newsletter' ),
'capability_type' => array('newsletter','newsletters'),
'has_archive' => true,
'hierarchical' => true,
'menu_position' => 5,
'supports' => array( 'title','thumbnail','comments','editor','excerpt' )
);
register_post_type( 'newsletter', $args );
}
add_action('init', 'post_types');
?>
Newsletters does not appear anywhere on my admin menu and I'm not sure what I am doing wrong.