Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('ajwpqsf_get_taxo','my_custom_process');
- function my_custom_process($taxo,$id, $gettaxo ){
- if($id='1222'){
- //put your form id here to test. Ensure that the changes only affect result from current form.
- $mytaxo = '';
- global $wp_query;
- $options = get_post_meta($id, 'ajaxwpqsf-relbool', true);
- $taxrel = isset($options[0]['tax']) ? $options[0]['tax'] : 'AND';
- if(!empty($gettaxo)){
- $mytaxo =array('relation' => $taxrel,'');
- foreach($gettaxo as $v){
- if(isset($v['term'])) {
- if( $v['term'] == 'awpqsftaxoall'){
- $mytaxo[] = array(
- 'taxonomy' => strip_tags( stripslashes($v['name'])),
- 'field' => 'slug',
- 'terms' => strip_tags( stripslashes($v['term'])),
- 'operator' => 'NOT IN'
- );
- }
- elseif(is_array($v['term'])){
- $mytaxo[] = array(
- 'taxonomy' => strip_tags( stripslashes($v['name'])),
- 'field' => 'slug',
- 'terms' =>$v['term'],
- 'operator' => 'AND'
- );
- }
- else{
- $mytaxo[] = array(
- 'taxonomy' => strip_tags( stripslashes($v['name'])),
- 'field' => 'slug',
- 'terms' => strip_tags( stripslashes($v['term'])),
- 'operator' => 'AND'
- );
- }
- }
- } //end foreach
- unset($mytaxo[0]);
- return $mytaxo;
- }
- return $taxo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement