<?php
    
	if ( get_theme_mod('opsi_editor') != "false" ) {
	    $showinrest = true;
	} else {
	    $showinrest = false;
    }
	
	register_post_type( 'galeri',		
	array(			
	    'menu_icon' => 'dashicons-format-gallery',
		'labels'          => array(				
	    'name'                => __( 'Galeri' ),				
	    'singular_name'       => __( 'Galeri' ),        
	    'add_new'             => __( 'Tambah Galeri ?' ),	
	    'add_new_item'        => __( 'Tambah Galeri' ),	
	    'edit'                => __( 'Edit' ),	 
	    'edit_item'           => __( 'Edit Galeri' ),	
	    'new_item'            => __( 'Item Galeri' ),	
	    'view'                => __( 'Lihat Galeri' ),	
	    'view_item'           => __( 'Lihat Item' ),	
	    'search_items'        => __( 'Cari Item' ),	
	    'not_found'           => __( 'Tidak Ada Galeri Ditemukan' ),	
	    'not_found_in_trash'  => __( 'Tidak Ada Galeri 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_galer',
				'edit_posts'                => 'edit_galers',
                'edit_others_posts'         => 'edit_other_galers',
				'edit_private_posts'        => 'edit_private_galers',
				'edit_published_posts'      => 'edit_published_galers',
				'read_post'                 => 'read_galer',
				'read_private_posts'        => 'read_private_galers',
				'publish_posts'             => 'publish_galers',
				'delete_post'               => 'delete_galer',
                'delete_posts'              => 'delete_galers',
                'delete_private_posts'      => 'delete_private_galers',
				'delete_others_posts'       => 'delete_others_galers',
                'delete_published_posts'    => 'delete_published_galers',
            ),
			'map_meta_cap' => true
		 )	
    );
?>