FEATURE Introducing this reusable component page
This commit is contained in:
parent
ecc664ad61
commit
bfc6241a1a
26
mu-plugins/carhop-post-types-supports.php
Normal file
26
mu-plugins/carhop-post-types-supports.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Bouton « Citer » dans le header d’article : opt-in par type de contenu.
|
||||
* Les types non listés (ex. actualités) n’affichent 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);
|
||||
Loading…
Reference in New Issue
Block a user