diff --git a/includes/post_types.php b/includes/post_types.php index a2c92bd..b3d9bbc 100644 --- a/includes/post_types.php +++ b/includes/post_types.php @@ -1,73 +1 @@ array( - 'name' => __('Publications'), - 'singular_name' => __('Publication') - ), - 'public' => true, - 'has_archive' => true, - 'show_in_rest' => true, - 'menu_icon' => 'dashicons-analytics', - 'menu_position' => 4, - 'supports' => array('title', 'custom-fields'), - ) - ); - register_post_type( - 'dbmob', - // CPT Options - array( - 'labels' => array( - 'name' => __('DBMOB'), - 'singular_name' => __('DBMOB') - ), - 'public' => true, - 'has_archive' => true, - 'rewrite' => array('slug' => 'dictionnaire'), - 'show_in_rest' => true, - 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode(''), - 'menu_position' => 5, - 'supports' => array('title', 'custom-fields'), - 'taxonomies' => array('category'), - ) - ); -} -add_action('init', 'carhop_create_posttype'); - - -/* ------------------------------------------------ - ##### CHANGE LE NOM DES POSTS PAR ACTUALITES - --------------------------------------------------*/ -function carhop_change_post_object() -{ - $get_post_type = get_post_type_object('post'); - $labels = $get_post_type->labels; - $labels->name = 'Actualités'; - $labels->singular_name = 'Actualité'; - $labels->add_new = 'Ajouter une actualité'; - $labels->add_new_item = 'Ajouter une nouvelle actualité'; - $labels->edit_item = 'Editer l\'actualité'; - $labels->new_item = 'Actualité'; - $labels->view_item = 'Voir l\'actualité'; - $labels->search_items = 'Chercher une actualité'; - $labels->not_found = 'Pas d\'actualité trouvée'; - $labels->not_found_in_trash = 'Pas d\'actualité trouvée dans la corbeille'; - $labels->all_items = 'Toutes les actualités'; - $labels->menu_name = 'Actualités'; - $labels->name_admin_bar = 'Actualités'; - - // remove_post_type_support('post', 'editor'); - unregister_taxonomy_for_object_type('category', 'post'); - unregister_taxonomy_for_object_type('post_tag', 'post'); -} - -add_action('init', 'carhop_change_post_object');