refactoring post type

This commit is contained in:
Antoine M 2024-01-31 19:45:36 +01:00
parent 7d32ebca46
commit 8ce3f075a8

View File

@ -1,29 +1,21 @@
<?php <?php
// #### POST TYPES // #### POST TYPES
function create_posttype() function create_posttype()
{ {
$args = array(
register_post_type( 'labels' => array(
'search-and-find', 'name' => __('Cherche trouve'),
// CPT Options 'singular_name' => __('Cherche trouve')
array( ),
'labels' => array( 'public' => true,
'name' => __('Cherche & trouve'), 'has_archive' => true,
'singular_name' => __('Cherche & trouve') 'show_in_rest' => true,
), 'menu_icon' => 'dashicons-table-row-delete',
'public' => true, 'menu_position' => 4,
'has_archive' => true, 'supports' => array('title', 'custom-fields', 'editor'),
'rewrite' => array('slug' => 'cherche-et-trouve'),
'show_in_rest' => true,
'menu_icon' => 'dashicons-table-row-delete',
'menu_position' => 4,
'supports' => array('title', 'custom-fields', 'editor'),
)
); );
register_post_type('search-and-find', $args);
} }
add_action('init', 'create_posttype'); add_action('init', 'create_posttype');