Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ryleef

    (@ryleef)

    Was able to “fix” this with the addition to the following code in class-gallery.php

    ***NEW***

    foreach ($this->taxa as $taxon => $terms) {
                $terms = $this->getTermIdsByNames($taxon, explode(',', $terms));
                foreach($terms as $term){
                    $taxa[] = array(
                          'taxonomy' => $taxon,
                          'field'    => 'id',
                          'terms'    => $term,
                          'operator' => isset($operator[$taxon]) ? $operator[$taxon] : 'IN'
                    );
                }
    
             }

    ***OLD***

    foreach ($this->taxa as $taxon => $terms) {
                $terms = $this->getTermIdsByNames($taxon, explode(',', $terms));
                    $taxa[] = array(
                          'taxonomy' => $taxon,
                          'field'    => 'id',
                          'terms'    => $terms,
                          'operator' => isset($operator[$taxon]) ? $operator[$taxon] : 'IN'
                    );
    
             }

    Created a separate array for each term so that the ‘AND’ relation worked as expected.

    If there is a “proper” way around this please comment below.

    Thread Starter ryleef

    (@ryleef)

    From a quick debug, it seems like it ignores the first value (form in this case) and only applies the second (contractor)

    Thread Starter ryleef

    (@ryleef)

    NOTE: I have also tested this with comma separated values:

    [dg descriptions=true fancy=true media_category=form,contractor relation=AND id=-1]

    This doesnt work and displays all files.

    I have also tested with quotes surrounding values (media_category="form")

Viewing 3 replies - 1 through 3 (of 3 total)