FEATURE Introducing this reusable component page

This commit is contained in:
Antoine M 2026-04-08 16:11:38 +02:00
parent ecc664ad61
commit bfc6241a1a

View File

@ -0,0 +1,26 @@
<?php
/**
* Bouton « Citer » dans le header darticle : opt-in par type de contenu.
* Les types non listés (ex. actualités) naffichent pas le bouton.
*
* @see post_type_supports( $post_type, 'carhop-citations' ) dans post-header.php
*/
function carhop_register_citation_support_for_post_types()
{
$types_with_citations = array(
'analyses-etudes',
'recherches',
'expositions',
'actualites',
'outils-pedagogiques',
'activites',
);
foreach ($types_with_citations as $post_type) {
if (post_type_exists($post_type)) {
add_post_type_support($post_type, 'carhop-citations');
}
}
}
add_action('init', 'carhop_register_citation_support_for_post_types', 11);