introducing parcours post type

This commit is contained in:
Antoine M 2024-04-16 12:36:52 +02:00
parent b50bb888dc
commit c68862c210

View File

@ -44,6 +44,7 @@ add_action('admin_menu', 'change_menu_icon');
// #### POST TYPES // #### POST TYPES
function create_posttype() function create_posttype()
{ {
// **** CONSEILS
register_post_type( register_post_type(
'conseils', 'conseils',
array( array(
@ -61,11 +62,12 @@ function create_posttype()
'show_in_rest' => true, 'show_in_rest' => true,
'menu_icon' => 'dashicons-pressthis', 'menu_icon' => 'dashicons-pressthis',
'menu_position' => 2, 'menu_position' => 2,
'supports' => array('title', 'editor', 'page-attributes', 'thumbnail'), 'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revision'),
// 'supports' => array('title', 'custom-fields', 'editor'), // 'supports' => array('title', 'custom-fields', 'editor'),
) )
); );
// **** BROCHURES
register_post_type( register_post_type(
'brochures', 'brochures',
array( array(
@ -74,15 +76,17 @@ function create_posttype()
'singular_name' => __('Brochure', 'homegrade-theme__texte-backoffice') 'singular_name' => __('Brochure', 'homegrade-theme__texte-backoffice')
), ),
'hierarchical' => true, 'hierarchical' => true,
'show_in_rest' => true,
'public' => true, 'public' => true,
'has_archive' => false, 'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-book', 'menu_icon' => 'dashicons-book',
'menu_position' => 2, 'menu_position' => 2,
'position' => 2, 'position' => 2,
'supports' => array('custom-fields', 'page-attributes', 'title'), 'supports' => array('custom-fields', 'page-attributes', 'title'),
) )
); );
// **** QUESTIONS
register_post_type( register_post_type(
'questions', 'questions',
array( array(
@ -92,14 +96,17 @@ function create_posttype()
), ),
'public' => true, 'public' => true,
'has_archive' => false, 'has_archive' => false,
// 'rewrite' => array('slug' => 'questions'),
// 'rewrite' => array('slug' => 'questions/%thematiques%'),
'show_in_rest' => true, 'show_in_rest' => true,
'menu_icon' => 'dashicons-editor-help', 'menu_icon' => 'dashicons-editor-help',
'menu_position' => 2.1, 'menu_position' => 2.1,
'supports' => array('title', 'custom-fields', 'editor', 'excerpt'), 'supports' => array('title', 'custom-fields', 'editor', 'excerpt', 'revision'),
// 'rewrite' => array('slug' => 'questions'),
// 'rewrite' => array('slug' => 'questions/%thematiques%'),
) )
); );
// **** FICHES-INFOS
register_post_type( register_post_type(
'fiches-infos', 'fiches-infos',
array( array(
@ -115,6 +122,8 @@ function create_posttype()
'supports' => array('title', 'custom-fields'), 'supports' => array('title', 'custom-fields'),
) )
); );
// **** VOCABULAIRE
register_post_type( register_post_type(
'vocabulaire', 'vocabulaire',
array( array(
@ -131,6 +140,8 @@ function create_posttype()
'supports' => array('title', 'custom-fields'), 'supports' => array('title', 'custom-fields'),
) )
); );
// **** JOBS
register_post_type( register_post_type(
'jobs', 'jobs',
array( array(
@ -148,6 +159,8 @@ function create_posttype()
) )
); );
// **** VIDEOS / WEBINAIRES
register_post_type( register_post_type(
'videos-webinaires', 'videos-webinaires',
array( array(
@ -165,6 +178,25 @@ function create_posttype()
) )
); );
// **** VIDEOS / WEBINAIRES
register_post_type(
'parcours',
array(
'labels' => array(
'name' => __('Parcours', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Parcours', 'homegrade-theme__texte-backoffice')
),
'public' => true,
'has_archive' => true,
'hierarchical' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-forms',
'supports' => array('title', 'custom-fields'),
'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revision'),
)
);
} }
add_action('init', 'create_posttype'); add_action('init', 'create_posttype');