From 8ce3f075a853d9c7658b44702f3fb1a78d66a551 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 31 Jan 2024 19:45:36 +0100 Subject: [PATCH] refactoring post type --- includes/post_types.php | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/includes/post_types.php b/includes/post_types.php index 3209e2f..556e229 100644 --- a/includes/post_types.php +++ b/includes/post_types.php @@ -1,29 +1,21 @@ array( - 'name' => __('Cherche & trouve'), - 'singular_name' => __('Cherche & trouve') - ), - 'public' => true, - 'has_archive' => true, - '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'), - - - ) + $args = array( + 'labels' => array( + 'name' => __('Cherche trouve'), + 'singular_name' => __('Cherche trouve') + ), + 'public' => true, + 'has_archive' => true, + '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');