<?php
    
	if ( get_theme_mod('opsi_editor') != "false" ) {
	    $showinrest = true;
	} else {
	    $showinrest = false;
    }
	
	register_post_type( 'editorial',		
	array(			
	    'menu_icon'       => 'dashicons-index-card',
		'labels'          => array(				
	    'name'                => __( 'Editorial' ),				
	    'singular_name'       => __( 'Editorial' ),        
	    'add_new'             => __( 'Tambah Editorial ?' ),	
	    'add_new_item'        => __( 'Tambah Editorial' ),	
	    'edit'                => __( 'Edit' ),	 
	    'edit_item'           => __( 'Edit Editorial' ),	
	    'new_item'            => __( 'Item Editorial' ),	
	    'view'                => __( 'Lihat Editorial' ),	
	    'view_item'           => __( 'Lihat Item' ),	
	    'search_items'        => __( 'Cari Item' ),	
	    'not_found'           => __( 'Tidak Ada Editorial Ditemukan' ),	
	    'not_found_in_trash'  => __( 'Tidak Ada Editorial di Folder Trash' ),	
	    'parent'              => __( 'Parent Super Duper' ),		
        'featured_image'      => __( 'Gambar Unggulan', 'wpsekolah' ),		
	    ),		                	
	    	'public'              => true,           					            
	    	'has_archive'         => true,        			            
	    	'supports'            => array( 'title', 'editor', 'thumbnail' ),        			            
	    	'exclude_from_search' => false,
			'show_in_rest'        => $showinrest,
			'capabilities' => array(
                'edit_post'                 => 'edit_editorial',
				'edit_posts'                => 'edit_editorials',
                'edit_others_posts'         => 'edit_other_editorials',
				'edit_private_posts'        => 'edit_private_editorials',
				'edit_published_posts'      => 'edit_published_editorials',
				'read_post'                 => 'read_editorial',
				'read_private_posts'        => 'read_private_editorials',
				'publish_posts'             => 'publish_editorials',
				'delete_post'               => 'delete_editorial',
                'delete_posts'              => 'delete_editorials',
                'delete_private_posts'      => 'delete_private_editorials',
				'delete_others_posts'       => 'delete_others_editorials',
                'delete_published_posts'    => 'delete_published_editorials',
            ),
			'map_meta_cap' => true
		 )	
    );
?>