diff --git a/includes/api.php b/includes/api.php index 6f33c0e..8083ca6 100644 --- a/includes/api.php +++ b/includes/api.php @@ -30,7 +30,6 @@ function build_search_artisan_posts_cards($request) $StringifiedTaxonomyIds = esc_html($request->get_param('taxonomy-ids')) ?? null; do_action('wpml_switch_language', $currentLanguage); - $test = __("Aucun résultat trouvé", "metiers-patrimoine-theme"); $lang = apply_filters('wpml_current_language', null); $taxonomyIds = explode(',', $StringifiedTaxonomyIds); $taxonomyIds = array_map('intval', $taxonomyIds); @@ -94,15 +93,15 @@ function build_search_artisan_posts_cards($request) $html_template = ob_get_clean(); - ob_start(); - get_template_part( - 'template-components/artisans/artisan-search-no-results', - null, - [] - ); - $html_template = ob_get_clean(); if ($newsPostsDatas->found_posts === 0) { + ob_start(); + get_template_part( + 'template-components/artisans/artisan-search-no-results', + null, + [] + ); + $html_template = ob_get_clean(); } $response_data = array( 'html_template' => $html_template, @@ -147,7 +146,6 @@ function debugQueryTest() ); $html_template = ob_get_clean(); $test = __("Aucun résultat trouvé", "metiers-patrimoine-theme"); - // write_log($test); return ($html_template); } // debugQueryTest();