[wp-trac] [WordPress Trac] #57300: parse_tax_query() does not handle array query param when taxonomy has rewrite set to hierarchical
WordPress Trac
noreply at wordpress.org
Fri Dec 9 07:00:44 UTC 2022
#57300: parse_tax_query() does not handle array query param when taxonomy has
rewrite set to hierarchical
---------------------------+------------------------------
Reporter: chamois_blanc | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 6.1.1
Severity: major | Resolution:
Keywords: | Focuses:
---------------------------+------------------------------
Comment (by chamois_blanc):
Or maybe like this:
{{{#!php
<?php
$term = $q[ $t->query_var ];
if ( ! empty( $t->rewrite['hierarchical'] ) ) {
if ( is_array( $term ) ) {
foreach ( $term as $k => $v ) {
$term[$k] = wp_basename( $v );
}
} else {
$term = wp_basename( $term );
}
}
if ( is_array( $term ) ) {
$term = implode( ',', $term );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57300#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list