<?php
function create_testimonial()
{
$labels = array(
'name' => _x('Testimonials', 'Post Type General Name', 'textdomain'),
'singular_name' => _x('Testimonial ', 'Post Type Singular Name', 'textdomain'),
'menu_name' => _x('Testimonials', 'Admin Menu text', 'textdomain'),
'name_admin_bar' => _x('Testimonials ', 'Add New on Toolbar', 'textdomain'),
'archives' => __('Testimonials Archives', 'textdomain'),
'attributes' => __('Testimonials Attributes', 'textdomain'),
'parent_item_colon' => __('Parent Testimonials :', 'textdomain'),
'all_items' => __('All Testimonials', 'textdomain'),
'add_new_item' => __('Add New Testimonials ', 'textdomain'),
'add_new' => __('Add New', 'textdomain'),
'new_item' => __('New Testimonials ', 'textdomain'),
'edit_item' => __('Edit Testimonials ', 'textdomain'),
'update_item' => __('Update Testimonials ', 'textdomain'),
'view_item' => __('View Testimonials ', 'textdomain'),
'view_items' => __('View Testimonials', 'textdomain'),
'search_items' => __('Search Testimonials ', 'textdomain'),
'not_found' => __('Not found', 'textdomain'),
'not_found_in_trash' => __('Not found in Trash', 'textdomain'),
'featured_image' => __('Featured Image', 'textdomain'),
'set_featured_image' => __('Set featured image', 'textdomain'),
'remove_featured_image' => __('Remove featured image', 'textdomain'),
'use_featured_image' => __('Use as featured image', 'textdomain'),
'insert_into_item' => __('Insert into Testimonials ', 'textdomain'),
'uploaded_to_this_item' => __('Uploaded to this Testimonials ', 'textdomain'),
'items_list' => __('Testimonials list', 'textdomain'),
'items_list_navigation' => __('Testimonials list navigation', 'textdomain'),
'filter_items_list' => __('Filter Testimonials list', 'textdomain'),
);
$rewrite = array(
'slug' => 'testimonial',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __('Testimonial ', 'textdomain'),
'description' => __('', 'textdomain'),
'labels' => $labels,
'menu_icon' => 'dashicons-format-chat',
'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes', 'post-formats', 'custom-fields'),
'taxonomies' => array(),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'hierarchical' => true,
'exclude_from_search' => true,
'show_in_rest' => true,
'publicly_queryable' => true,
'capability_type' => 'post',
'rewrite' => $rewrite,
);
register_post_type('testimonial', $args);
register_taxonomy('testimonial_category', 'testimonial', array('hierarchical' => true, 'label' => 'Category', 'query_var' => true, 'rewrite' => array('slug' => 'testimonial-category')));
}
add_action('init', 'create_testimonial', 0);
?>