if ( ! function_exists('register_cpt_ikv_persons') ) { // Register Custom Post Type function register_cpt_ikv_persons() { $labels = array( 'name' => _x( 'Persons', 'Post Type General Name', 'ikv' ), 'singular_name' => _x( 'Person', 'Post Type Singular Name', 'ikv' ), 'menu_name' => __( 'Persons', 'ikv' ), 'name_admin_bar' => __( 'Persons', 'ikv' ), 'archives' => __( '', 'ikv' ), 'attributes' => __( '', 'ikv' ), 'parent_item_colon' => __( '', 'ikv' ), 'all_items' => __( 'All Persons', 'ikv' ), 'add_new_item' => __( 'Add New Person', 'ikv' ), 'add_new' => __( 'Add New', 'ikv' ), 'new_item' => __( 'New Person', 'ikv' ), 'edit_item' => __( 'Edit Person', 'ikv' ), 'update_item' => __( 'Update Person', 'ikv' ), 'view_item' => __( 'View Person', 'ikv' ), 'view_items' => __( 'View Persons', 'ikv' ), 'search_items' => __( 'Search Person', 'ikv' ), 'not_found' => __( 'Not found', 'ikv' ), 'not_found_in_trash' => __( 'Not found in Trash', 'ikv' ), 'featured_image' => __( 'Featured Image', 'ikv' ), 'set_featured_image' => __( 'Set featured image', 'ikv' ), 'remove_featured_image' => __( 'Remove featured image', 'ikv' ), 'use_featured_image' => __( 'Use as featured image', 'ikv' ), 'insert_into_item' => __( '', 'ikv' ), 'uploaded_to_this_item' => __( 'Uploaded to this Person', 'ikv' ), 'items_list' => __( 'Person list', 'ikv' ), 'items_list_navigation' => __( 'Persons list navigation', 'ikv' ), 'filter_items_list' => __( 'Filter Person list', 'ikv' ), ); $rewrite = array( 'slug' => 'person', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __( 'Person', 'ikv' ), 'description' => __( 'IKV Person', 'ikv' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'page-attributes' ), 'hierarchical' => true, 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 70, 'menu_icon' => 'dashicons-businessperson', 'show_in_admin_bar' => true, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', 'show_in_rest' => true, 'rest_base' => 'persons', ); register_post_type( 'cpt_ikv_person', $args ); } add_action( 'init', 'register_cpt_ikv_persons', 0 ); }