FEATURE changing default taxonomy when not passed to the component
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nonimart 2025-09-01 17:11:05 +02:00
parent e2f328a3ed
commit cd5d99a45c
2 changed files with 4 additions and 6 deletions

View File

@ -19,12 +19,13 @@ function build_search_artisan_posts_cards($request)
$currentLanguage = esc_html($request->get_param('current-page-language')) ?? 'fr';
$previousActivePage = esc_html($request->get_param('active-page')) ?? 1;
$postsPerPage = esc_html($request->get_param('posts-per-page')) ?? 12;
$taxonomy = esc_html($request->get_param('taxonomy')) ?? 'metiers';
$taxonomy = esc_html($request->get_param('taxonomy'));
$taxonomy = empty($taxonomy) ? null : $taxonomy;
$localisation = esc_html($request->get_param('localisation')) ?? null;
$StringifiedTaxonomyIds = esc_html($request->get_param('taxonomy-ids')) ?? null;
do_action('wpml_switch_language', $currentLanguage);
// $lang = apply_filters('wpml_current_language', null);
$taxonomyIds = explode(',', $StringifiedTaxonomyIds);
$taxonomyIds = array_map('intval', $taxonomyIds);
$search_value = sanitize_text_field($request->get_param('search')) ?? null;

View File

@ -1,8 +1,5 @@
<?php
$postID = $args['post_ID'];
// global $post;
// $post = get_post($postID);
// $post_name = $post->post_name;
$post_name = get_post_field('post_name', $postID);
$current_lang = apply_filters('wpml_current_language', null);
@ -16,7 +13,7 @@ $artisans_clean_url = get_site_url() . '/' . $lang_extension . 'artisans/' . $po
$company_members = get_field('company_members', $postID);
$currentTaxonomy = $args['current_taxonomy'];
$currentTaxonomy = $args['current_taxonomy'] ?? 'elementsbatiments';
$taxonomySortedTerms = $currentTaxonomy === "elementsbatiments" ? get_the_terms_organised_by_parent('elementsbatiments', $postID) : get_the_terms_organised_by_parent('metiers', $postID);