Viewing 1 replies (of 1 total)
  • Thread Starter Stefan

    (@axenstar86)

    Got it working now, without hte plugin. Thanks to

    https://www.ads-software.com/support/topic/search-multiple-taxonomies-witch-checkboxes

    Just use the following code in your functions.php

    //explode checkboxes array when doing a search
    	$_GET = yclads_implode_checkboxes_taxonomies($_GET);
    
    function yclads_implode_checkboxes_taxonomies($request_var) {
    
    	$args = array('your tax here');
    
    	foreach($request_var as $arg_key=>$arg_value) {
    		unset($value);
    		if (!in_array($arg_key,$args)) continue;
    		$value= $request_var[$arg_key];
    		if (!$value) continue;
    		if (!is_array($value)) continue;
    		$new_args[$arg_key]=implode(',',$value); //'OR' operator
    	}
    
    	$new_args = array_filter((array)$new_args);
    	$output = wp_parse_args( $new_args, $request_var );
    
    	//DEBUG
    	$yclads_debug['checkboxes_args_before']=$request_var;
    	$yclads_debug['checkboxes_args_after']=$output;
    
    	return $output;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Integrate QMT funcktions into existing Form’ is closed to new replies.