Custom Post Type – Access
-
Hey,
I have added a Custom Post Type, which displays the posts on my homepage. However, if a user logs onto my wordpress and is an ‘author’, they can still see and submit a new post in the custom post type. I would only like administrators to be able to see/add a new post to the custom post type.
However, let EVERYONE see the posts on the actual site.
Is this possible?
My CPT function:
add_action(‘init’, ‘home_slider_post_type’);
function home_slider_post_type() {
register_post_type(‘home-slider’, array(
‘labels’ => array(
‘name’ => ‘Home Slider’,
‘singular_name’ => ‘Slider’,
‘add_new’ => ‘Add new slider’,
‘edit_item’ => ‘Edit slider’,
‘new_item’ => ‘New slider’,
‘view_item’ => ‘View slider’,
‘search_items’ => ‘Search sliders’,
‘not_found’ => ‘No sliders found’,
‘not_found_in_trash’ => ‘No sliders found in Trash’
),
‘public’ => true,
‘supports’ => array(
‘title’,
‘excerpt’,
‘thumbnail’,
‘editor’
),
‘taxonomies’ => array(‘post_tag’) // this is IMPORTANT
));
}
- The topic ‘Custom Post Type – Access’ is closed to new replies.