FEATURE Introducing analyses et etudes post type
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2026-01-30 10:14:26 +01:00
parent d9e6ecff12
commit ab1c3aee52

View File

@ -17,24 +17,7 @@ function carhop_create_posttype()
$current_site = get_current_blog_id();
if ($current_site !== 1) return;
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('<svg width="96" height="74" viewBox="0 0 96 74" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M86.4 2.2C81.6 0.7 76.3 0 71.3 0C62.9 0 53.8 1.7 47.5 6.5C41.2 1.7 32.2 0 23.8 0C15.4 0 6.3 1.7 0 6.5V69.8C0 70.9 1.1 72 2.2 72C3.3 72 2.8 71.8 3.3 71.8C9.1 69 17.6 67 23.8 67C30 67 41.3 68.7 47.6 73.5C53.4 69.8 64 67 71.4 67C78.8 67 85.9 68.3 91.9 71.5C92.3 71.7 92.5 71.7 93 71.7C94.1 71.7 95.2 70.6 95.2 69.5V6.5C92.6 4.6 89.8 3.3 86.6 2.2H86.4ZM86.4 60.5C81.6 59 76.5 58.3 71.3 58.3C64 58.3 53.4 61.1 47.5 64.8V15.1C53.3 11.4 63.9 8.6 71.3 8.6C78.7 8.6 81.7 9.2 86.4 10.8V60.5Z" fill="black"/></svg>'),
'menu_position' => 5,
'supports' => array('title', 'custom-fields'),
'taxonomies' => array('category'),
)
);
register_post_type(
'equipe',
// CPT Options
@ -61,6 +44,44 @@ function carhop_create_posttype()
'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('<svg width="96" height="74" viewBox="0 0 96 74" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M86.4 2.2C81.6 0.7 76.3 0 71.3 0C62.9 0 53.8 1.7 47.5 6.5C41.2 1.7 32.2 0 23.8 0C15.4 0 6.3 1.7 0 6.5V69.8C0 70.9 1.1 72 2.2 72C3.3 72 2.8 71.8 3.3 71.8C9.1 69 17.6 67 23.8 67C30 67 41.3 68.7 47.6 73.5C53.4 69.8 64 67 71.4 67C78.8 67 85.9 68.3 91.9 71.5C92.3 71.7 92.5 71.7 93 71.7C94.1 71.7 95.2 70.6 95.2 69.5V6.5C92.6 4.6 89.8 3.3 86.6 2.2H86.4ZM86.4 60.5C81.6 59 76.5 58.3 71.3 58.3C64 58.3 53.4 61.1 47.5 64.8V15.1C53.3 11.4 63.9 8.6 71.3 8.6C78.7 8.6 81.7 9.2 86.4 10.8V60.5Z" fill="black"/></svg>'),
'menu_position' => 5,
'supports' => array('title', 'custom-fields'),
'taxonomies' => array('category'),
)
);
register_post_type(
'analyses-etudes',
// CPT Options
array(
'labels' => array(
'name' => __('Analyses et études'),
'singular_name' => __('Analyse ou étude'),
'menu_name' => 'Analyses&Études',
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'analyses-etudes'),
'show_in_rest' => true,
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg xmlns="http://www.w3.org/2000/svg" width="46.3" height="63" viewBox="0 0 46.3 63"><path d="M44.6,8.5c-.8,0-1.5.7-1.5,1.5v37.1c0,1.6-1.3,2.9-2.9,2.9h-17.4v-2.5c0-.8-.7-1.5-1.5-1.5h-8c-.4,0-.8.2-1.1.4s-.4.7-.4,1.1v2.5h-5.9c-1.4,0-2.6-.8-3-2.2,0-.6,0-1.3.5-1.8.9-.9,2.1-1.4,3.4-1.4h29.7c2.7,0,4.8-2.2,4.8-4.8V6.5c0-3.6-2.9-6.5-6.5-6.5H6.5C2.9,0,0,2.9,0,6.5v41c0,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7-.7h0Z" fill="black"/></svg>'),
'menu_position' => 5,
'supports' => array('title', 'custom-fields'),
'taxonomies' => array('category'),
)
);
}
add_action('init', 'carhop_create_posttype');