refactoring for better local handling

This commit is contained in:
Antoine M 2023-11-28 16:59:44 +01:00
parent ec31f19d44
commit 374b459ff1

View File

@ -1,7 +1,20 @@
<?php
$block_titling = get_field('block_titling_description_datas');
if (!function_exists('get_automatic_post')) {
function get_automatic_post($post_thematique)
{
$automatic_query_args = array(
'post_per_page' => 1,
'post_status' => 'publish',
'post_type' => 'questions',
'thematiques' => $post_thematique,
'include_children' => true,
);
return get_posts($automatic_query_args)[0] ?? null;
}
}
?>
@ -16,11 +29,15 @@ $block_titling = get_field('block_titling_description_datas');
'taxonomy' => 'thematiques',
'hide_empty' => false,
'parent' => 0
));
foreach ($thematique_terms as $key => $thematique) {
if ($thematique->slug === "renovation-circulaire") continue;
if (
$thematique->slug === "renovation-circulaire"
|| $thematique->slug === "circulaire-renovatie"
|| $thematique->slug === "au-quotidien"
|| $thematique->slug === "dagelijks"
) continue;
// $thematique_datas = get_term_by('slug', $thematique->slug, 'thematiques');