<?php
    if ( get_theme_mod('sekolah_type') != "akademi" ) {
		$type_sch = 'Guru';
	} else {
		$type_sch = 'Dosen';
	}
	if ( get_theme_mod('opsi_editor') != "false" ) {
	    $showinrest = true;
	} else {
	    $showinrest = false;
    }
	
    register_post_type( 'blog',		
	array(			
	    'menu_icon'       => 'dashicons-format-status',
		'labels'          => array(				
	    'name'                => __( 'Blog '.$type_sch ),				
	    'singular_name'       => __( 'Blog '.$type_sch ),        
	    'add_new'             => __( 'Tambah Tulisan ?' ),	
	    'add_new_item'        => __( 'Tambah Tulisan' ),	
	    'edit'                => __( 'Edit' ),	 
	    'edit_item'           => __( 'Edit Tulisan' ),	
	    'new_item'            => __( 'Item Tulisan' ),	
	    'view'                => __( 'Lihat Tulisan' ),	
	    'view_item'           => __( 'Lihat Item' ),	
	    'search_items'        => __( 'Cari Item' ),	
	    'not_found'           => __( 'Tidak Ada Tulisan Ditemukan' ),	
	    'not_found_in_trash'  => __( 'Tidak Ada Tulisan di Folder Trash' ),	
	    'parent'              => __( 'Parent Super Duper' ),		
        'featured_image'      => __( 'Gambar Unggulan' ),		
	    ),		                	
	    	'public'              => true,           					            
	    	'has_archive'         => true,        			            
	    	'supports'            => array( 'title', 'editor', 'thumbnail', 'comments', 'author' ),        			            
	    	'exclude_from_search' => false,
			'show_in_rest'        => $showinrest,
			'capabilities' => array(
                'edit_post'                 => 'edit_blog',
				'edit_posts'                => 'edit_blogs',
                'edit_others_posts'         => 'edit_other_blogs',
				'edit_private_posts'        => 'edit_private_blogs',
				'edit_published_posts'      => 'edit_published_blogs',
				'read_post'                 => 'read_blog',
				'read_private_posts'        => 'read_private_blogs',
				'publish_posts'             => 'publish_blogs',
				'delete_post'               => 'delete_blog',
                'delete_posts'              => 'delete_blogs',
                'delete_private_posts'      => 'delete_private_blogs',
				'delete_others_posts'       => 'delete_others_blogs',
                'delete_published_posts'    => 'delete_published_blogs',
            ),
			'map_meta_cap' => true
		 )	
    );
	
?>