Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cptui_register_my_cpts_testimonials() {
- /**
- * Post Type: Testimonials.
- */
- $labels = [
- "name" => __( "Testimonials", "customtheme" ),
- "singular_name" => __( "Testimonial", "customtheme" ),
- "menu_name" => __( "Testimonials", "customtheme" ),
- "all_items" => __( "All Testimonials", "customtheme" ),
- "add_new" => __( "Add new", "customtheme" ),
- "add_new_item" => __( "Add new Testimonial", "customtheme" ),
- "edit_item" => __( "Edit Testimonial", "customtheme" ),
- "new_item" => __( "New Testimonial", "customtheme" ),
- "view_item" => __( "View Testimonial", "customtheme" ),
- "view_items" => __( "View Testimonials", "customtheme" ),
- "search_items" => __( "Search Testimonials", "customtheme" ),
- "not_found" => __( "No Testimonials found", "customtheme" ),
- "not_found_in_trash" => __( "No Testimonials found in trash", "customtheme" ),
- "parent" => __( "Parent Testimonials:", "customtheme" ),
- "featured_image" => __( "Featured image for this Testimonial", "customtheme" ),
- "set_featured_image" => __( "Set featured image for this Testimonial", "customtheme" ),
- "remove_featured_image" => __( "Remove featured image for this Testimonial", "customtheme" ),
- "use_featured_image" => __( "Use as featured image for this Testimonial", "customtheme" ),
- "archives" => __( "Testimonial archives", "customtheme" ),
- "insert_into_item" => __( "Insert into Testimonial", "customtheme" ),
- "uploaded_to_this_item" => __( "Upload to this Testimonial", "customtheme" ),
- "filter_items_list" => __( "Filter Testimonials list", "customtheme" ),
- "items_list_navigation" => __( "Testimonials list navigation", "customtheme" ),
- "items_list" => __( "Testimonials list", "customtheme" ),
- "attributes" => __( "Testimonial attributes", "customtheme" ),
- "name_admin_bar" => __( "Testimonial", "customtheme" ),
- "item_published" => __( "Testimonials published", "customtheme" ),
- "item_published_privately" => __( "Testimonial published privately.", "customtheme" ),
- "item_reverted_to_draft" => __( "Testimonial reverted to draft.", "customtheme" ),
- "item_scheduled" => __( "Testimonial scheduled", "customtheme" ),
- "item_updated" => __( "Testimonial updated.", "customtheme" ),
- "parent_item_colon" => __( "Parent Testimonials:", "customtheme" ),
- ];
- $args = [
- "label" => __( "Testimonials", "customtheme" ),
- "labels" => $labels,
- "description" => "Testimonial Posts",
- "public" => true,
- "publicly_queryable" => true,
- "show_ui" => true,
- "show_in_rest" => false,
- "rest_base" => "",
- "rest_controller_class" => "WP_REST_Posts_Controller",
- "has_archive" => "testimonials",
- "show_in_menu" => true,
- "show_in_nav_menus" => true,
- "delete_with_user" => false,
- "exclude_from_search" => false,
- "capability_type" => "post",
- "map_meta_cap" => true,
- "hierarchical" => false,
- "rewrite" => [ "slug" => "testimonials", "with_front" => true ],
- "query_var" => true,
- "menu_position" => 9,
- "menu_icon" => "dashicons-testimonial",
- "supports" => [ "title", "editor", "thumbnail" ],
- "show_in_graphql" => false,
- ];
- register_post_type( "testimonials", $args );
- }
- add_action( 'init', 'cptui_register_my_cpts_testimonials' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement