diff --git a/includes/post_types.php b/includes/post_types.php index 2bd7116..8d1da1f 100644 --- a/includes/post_types.php +++ b/includes/post_types.php @@ -3,50 +3,69 @@ /* ------------------------------------------------ ##### POST TYPES --------------------------------------------------*/ -function create_posttype() +function dynamiques_create_posttype() { register_post_type( - 'publications', + 'revues', // CPT Options array( 'labels' => array( - 'name' => __('Publications'), - 'singular_name' => __('Publication') + 'name' => __('Revues'), + 'singular_name' => __('Revue') ), 'public' => true, 'has_archive' => true, 'show_in_rest' => true, - 'menu_icon' => 'dashicons-analytics', + 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode(''), 'menu_position' => 4, - 'supports' => array('title', 'custom-fields'), + 'supports' => array( + 'title', + 'editor', + 'thumbnail', + 'excerpt', + 'custom-fields', + 'revisions', + 'author', + ), + ) ); register_post_type( - 'dbmob', + 'articles', // CPT Options array( 'labels' => array( - 'name' => __('DBMOB'), - 'singular_name' => __('DBMOB') + 'name' => __('Articles'), + 'singular_name' => __('Articles') ), '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'), + 'menu_icon' => 'dashicons-edit-page', + 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode(''), + 'menu_position' => 4, + 'supports' => array( + 'title', + 'editor', + 'thumbnail', + 'excerpt', + 'custom-fields', + 'revisions', + 'author', + ), + + ) ); } -add_action('init', 'create_posttype'); +add_action('init', 'dynamiques_create_posttype'); /* ------------------------------------------------ ##### CHANGE LE NOM DES POSTS PAR ACTUALITES --------------------------------------------------*/ -function deligraph_theme_change_post_object() +function dynamiques_change_post_object() { $get_post_type = get_post_type_object('post'); $labels = $get_post_type->labels; @@ -64,9 +83,9 @@ function deligraph_theme_change_post_object() $labels->menu_name = 'Actualités'; $labels->name_admin_bar = 'Actualités'; - remove_post_type_support('post', 'editor'); + // remove_post_type_support('post', 'editor'); unregister_taxonomy_for_object_type('category', 'post'); unregister_taxonomy_for_object_type('post_tag', 'post'); } -add_action('init', 'deligraph_theme_change_post_object'); +add_action('init', 'dynamiques_change_post_object');