@@ -365,6 +365,50 @@ function create_initial_post_types() {
365365 )
366366 );
367367
368+ register_post_type (
369+ 'wp_template_part ' ,
370+ array (
371+ 'labels ' => array (
372+ 'name ' => __ ( 'Template Parts ' ),
373+ 'singular_name ' => __ ( 'Template Part ' ),
374+ 'menu_name ' => _x ( 'Template Parts ' , 'Admin Menu text ' ),
375+ 'add_new ' => _x ( 'Add New ' , 'Template Part ' ),
376+ 'add_new_item ' => __ ( 'Add New Template Part ' ),
377+ 'new_item ' => __ ( 'New Template Part ' ),
378+ 'edit_item ' => __ ( 'Edit Template Part ' ),
379+ 'view_item ' => __ ( 'View Template Part ' ),
380+ 'all_items ' => __ ( 'All Template Parts ' ),
381+ 'search_items ' => __ ( 'Search Template Parts ' ),
382+ 'parent_item_colon ' => __ ( 'Parent Template Part: ' ),
383+ 'not_found ' => __ ( 'No template parts found. ' ),
384+ 'not_found_in_trash ' => __ ( 'No template parts found in Trash. ' ),
385+ 'archives ' => __ ( 'Template part archives ' ),
386+ 'insert_into_item ' => __ ( 'Insert into template part ' ),
387+ 'uploaded_to_this_item ' => __ ( 'Uploaded to this template part ' ),
388+ 'filter_items_list ' => __ ( 'Filter template parts list ' ),
389+ 'items_list_navigation ' => __ ( 'Template parts list navigation ' ),
390+ 'items_list ' => __ ( 'Template parts list ' ),
391+ ),
392+ 'description ' => __ ( 'Template parts to include in your templates. ' ),
393+ 'public ' => false ,
394+ 'has_archive ' => false ,
395+ 'show_ui ' => true ,
396+ 'show_in_menu ' => 'themes.php ' ,
397+ 'show_in_admin_bar ' => false ,
398+ 'show_in_rest ' => true ,
399+ 'rest_base ' => 'template-parts ' ,
400+ 'rest_controller_class ' => 'WP_REST_Templates_Controller ' ,
401+ 'map_meta_cap ' => true ,
402+ 'supports ' => array (
403+ 'title ' ,
404+ 'slug ' ,
405+ 'excerpt ' ,
406+ 'editor ' ,
407+ 'revisions ' ,
408+ ),
409+ )
410+ );
411+
368412 register_post_status (
369413 'publish ' ,
370414 array (
0 commit comments