How do I get the URL var string for a particular taxonomy?

[ad_1]

Hello @averixus

Thank you for using Filter Everything plugin.

There are two functions that can help you to find all selected filters on a page ‘flrt_is_filter_request’ and ‘flrt_selected_filter_terms’. The first one gives you information if the current page is filter request, the second gives you all data of selected filters:

if ( function_exists('flrt_is_filter_request') ) {
    if( flrt_is_filter_request() ){
        $selected_fitlers = flrt_selected_filter_terms();
        var_dump( $selected_fitlers );
    }
}

This code will show you something like this:

array(2) {
  ["color"]=>
  array(10) {
    ["entity"]=>
    string(8) "taxonomy"
    ["e_name"]=>
    string(8) "pa_color"
    ["slug"]=>
    string(5) "color"
    ["in_path"]=>
    string(3) "yes"
    ["values"]=>
    array(1) {
      [0]=>
      string(5) "black"
    }
    ["founded_in_path"]=>
    string(3) "yes"
    ["logic"]=>
    string(2) "or"
    ["show_chips"]=>
    string(3) "yes"
    ["label"]=>
    string(5) "Color"
    ["used_for_variations"]=>
    string(3) "yes"
  }
  ["brand"]=>
  array(10) {
    ["entity"]=>
    string(8) "taxonomy"
    ["e_name"]=>
    string(8) "pa_brand"
    ["slug"]=>
    string(5) "brand"
    ["in_path"]=>
    string(3) "yes"
    ["values"]=>
    array(1) {
      [0]=>
      string(5) "apple"
    }
    ["founded_in_path"]=>
    string(3) "yes"
    ["logic"]=>
    string(2) "or"
    ["show_chips"]=>
    string(3) "yes"
    ["label"]=>
    string(5) "Brand"
    ["used_for_variations"]=>
    string(2) "no"
  }
}

Where array keys are filter URL variables.
I hope this will help you.

More functions you can find here – https://filtereverything.pro/resources/functions/

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer