FIX Force wame pictures between NL and FR Query
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nonimart 2025-07-10 11:11:28 +02:00
parent 44ed1be6d3
commit f4289faa13

View File

@ -141,7 +141,7 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
)
)
);
$chantiers = new WP_Query($args);
$chantiers = new WP_Query($args);
?>
<?php if ($chantiers->posts): ?>
<section class="artisans-post__section artisans-post__section--chantiers">
@ -155,7 +155,13 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
$localisation = get_field('localisation', $chantier->ID) ?? null;
$city = $localisation['city'] ?? null;
$pictures = get_field('pictures', $chantier->ID);
//########## FORCE GET_FIELD IN FR TO BE SURE WE HAVE SAME PICTURES BETWEEN FR AND NL ##########
$chantier_fr_id = apply_filters('wpml_object_id', $chantier->ID, 'chantiers', TRUE, 'fr');
$current_lang = apply_filters('wpml_current_language', NULL);
do_action('wpml_switch_language', 'fr');
$pictures = get_field('pictures', $chantier_fr_id);
do_action('wpml_switch_language', $current_lang);
$chantier_name = get_field('chantier_name', $chantier->ID);
?>
<div class="chantier">
@ -182,7 +188,6 @@ $pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
</section>
<?php endif; ?>
</div>
</div>