Bagaimana saya bisa menghapus jenis posting khusus ini agar tidak ditampilkan di dashboard untuk pengguna non admin?
/* Add Websites Custom Post Type */
add_action( 'init', 'create_website_type' );
function create_website_type() {
register_post_type( 'website',
array(
'labels' => array(
'name' => __( 'Websites' ),
'singular_name' => __( 'Website' ),
'add_new' => __( 'Add New Website' ),
'add_new_item' => __( 'Add New Website' ),
'edit' => __( 'Edit Website' ),
'edit_item' => __( 'Edit Website' ),
'new_item' => __( 'Add New Website' ),
'view' => __( 'View Website' ),
'view_item' => __( 'View Website' ),
'search_items' => __( 'Search Websites' ),
'not_found' => __( 'No Websites Found' ),
'not_found_in_trash' => __( 'No Websites found in Trash' ),
),
'description' => __('Websites to be shown in Resources section.'),
'public' => true,
'show_ui' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'menu_position' => 20,
'supports' => array('title', 'editor'),
'can_export' => true
)
);
remove_post_type_support('website','editor');
}
user_has_cap
. Lihat jawaban ini sebagai contoh.