ryleef
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [Document Gallery] Multiple Categories with 'AND' relationWas 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.
Forum: Plugins
In reply to: [Document Gallery] Multiple Categories with 'AND' relationFrom a quick debug, it seems like it ignores the first value (
formin this case) and only applies the second (contractor)Forum: Plugins
In reply to: [Document Gallery] Multiple Categories with 'AND' relationNOTE: 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)