<?php
    
	if ( get_theme_mod('opsi_editor') != "false" ) {
	    $showinrest = true;
	} else {
	    $showinrest = false;
    }
	
	register_post_type( 'pengumuman',		
	array(			
	    'menu_icon'       => 'dashicons-format-aside',
		'labels'          => array(				
	    'name'                => __( 'Pengumuman' ),				
	    'singular_name'       => __( 'Pengumuman' ),        
	    'add_new'             => __( 'Tambah Pengumuman ?' ),	
	    'add_new_item'        => __( 'Tambah Pengumuman' ),	
	    'edit'                => __( 'Edit' ),	 
	    'edit_item'           => __( 'Edit Pengumuman' ),	
	    'new_item'            => __( 'Item Pengumuman' ),	
	    'view'                => __( 'Lihat Pengumuman' ),	
	    'view_item'           => __( 'Lihat Item' ),	
	    'search_items'        => __( 'Cari Item' ),	
	    'not_found'           => __( 'Tidak Ada Pengumuman Ditemukan' ),	
	    'not_found_in_trash'  => __( 'Tidak Ada Pengumuman di Folder Trash' ),	
	    'parent'              => __( 'Parent Super Duper' ),		
        'featured_image'      => __( 'Gambar Unggulan' ),		
	    ),		                	
	    	'public'              => true,           					            
	    	'has_archive'         => true,        			            
	    	'supports'            => array( 'title', 'editor', 'thumbnail' ),        			            
	    	'exclude_from_search' => false,
			'show_in_rest'        => $showinrest,
			'capabilities' => array(
                'edit_post'                 => 'edit_peng',
				'edit_posts'                => 'edit_pengs',
                'edit_others_posts'         => 'edit_other_pengs',
				'edit_private_posts'        => 'edit_private_pengs',
				'edit_published_posts'      => 'edit_published_pengs',
				'read_post'                 => 'read_peng',
				'read_private_posts'        => 'read_private_pengs',
				'publish_posts'             => 'publish_pengs',
				'delete_post'               => 'delete_peng',
                'delete_posts'              => 'delete_pengs',
                'delete_private_posts'      => 'delete_private_pengs',
				'delete_others_posts'       => 'delete_others_pengs',
                'delete_published_posts'    => 'delete_published_pengs',
            ),
			'map_meta_cap' => true
		 )	
    );
?>