WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
[Bug reports]Problem was found in the plugin (2 posts)

  1. uradvd
    Member
    Posted 1 year ago #

    found several problems with filtering posts (I have the goods on the site) with different taxonomies.
    1. When you select a taxonomy term Amount in other terms is increased by a surprising number that is present in the chosen terms.
    everything is good and shows how to
    http://handmademart.net/?product_category=biser-yaponiya

    10/0(61)
    11/0(1)
    12/0(16)
    13/0(2)
    15/0(3)
    6/0(0)
    8/0(0)

    When you add additional term
    http://handmademart.net/?product_category=biser-yaponiya&product_size_beads=10-0

    10/0(61) this chosen current term
    11/0(62) (selected 10/0(61)term)+ 11/0(1)= 62 counts term
    12/0(77) (selected 10/0(61)term)+ 12/0(16)= 77
    13/0(63) (selected 10/0(61)term)+ 13/0(2)= 63
    15/0(64) etc.
    6/0(61) etc.
    8/0(61) etc.

    2. Option 2 does not work in the same taxonomy terms
    http://handmademart.net/?product_category=biser-yaponiya&product_size_beads=10-0+11-0

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/

  2. uradvd
    Member
    Posted 1 year ago #

    fix from 2.
    test and work taxonomy=term,term&taxonomy=term+term+etc..

    # This patch file was generated by NetBeans IDE
    # It uses platform neutral UTF-8 encoding and \n newlines.
    --- <html>core.php (<b>b1f20a4</b>)</html>
    +++ <html><b>Current File</b></html>
    @@ -145,7 +145,7 @@
     		if ( empty( $value ) )
     			unset( $query[ $taxonomy ] );
     		else
    -			$query[ $taxonomy ] = trim( implode( '+', $value ), '+' );
    +			$query[ $taxonomy ] = trim( implode( ',', $value ), ',' );
    
     		return self::get( $query );
     	}
    @@ -181,7 +181,7 @@
     		$title = array();
    
     		foreach ( qmt_get_query() as $tax => $value ) {
    -			$terms = preg_split( '/[+,]+/', $value );
    +			$terms = preg_split( '/[+,],/', $value );
    
     			$out = array();
     			foreach ( $terms as $slug ) {
    @@ -197,7 +197,7 @@
     			else
     				$key = $tax_obj->labels->name;
    
    -			$title[] .= $key . ': ' . implode( ' + ', $out );
    +			$title[] .= $key . ': ' . implode( ' , ', $out );
     		}
    
     		return implode( '; ', $title );
    @@ -244,7 +244,7 @@
     		}
    
     		foreach ( $qmt_query as &$value )
    -			$value = implode( '+', $value );
    +			$value = implode( ',', $value );
     	}
    
     	if ( $taxname ) {
    # This patch file was generated by NetBeans IDE
    # It uses platform neutral UTF-8 encoding and \n newlines.
    --- <html>walkers.php (<b>b1cfeaa</b>)</html>
    +++ <html><b>Current File</b></html>
    @@ -40,7 +40,7 @@
    
             // considering previous choices
             foreach ( $old_query as $old_taxonomy => $old_terms ) {
    -            $terms = explode( '+', $old_terms );
    +            $terms = explode( ',', $old_terms );
    
                 if ( !isset( $count_filter[$old_taxonomy] ) ) {
                     $count_filter[$old_taxonomy] = $terms;
    @@ -82,7 +82,7 @@
     	}
    
     	protected function set_selected_terms() {
    -		$this->selected_terms = explode( '+', qmt_get_query( $this->taxonomy ) );
    +		$this->selected_terms = explode( ',', qmt_get_query( $this->taxonomy ) );
     	}
    
     	// Make start_el() and end_el()

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.