Skip to content

Commit

Permalink
Filters: Pattern categories can only be selected one at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Mar 20, 2024
1 parent 58e8aa2 commit cfa9b11
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,23 +249,8 @@ function get_status_options( $options ) {
function inject_other_filters( $key ) {
global $wp_query;

// Multiple-select query parameters.
$query_vars = [ 'pattern-categories' ];
foreach ( $query_vars as $query_var ) {
if ( ! isset( $wp_query->query[ $query_var ] ) ) {
continue;
}
if ( $key === $query_var ) {
continue;
}
$values = (array) $wp_query->query[ $query_var ];
foreach ( $values as $value ) {
printf( '<input type="hidden" name="%s[]" value="%s" />', esc_attr( $query_var ), esc_attr( $value ) );
}
}

// Single-select query parameters.
$query_vars = [ 'order', 'orderby', 'curation' ];
$query_vars = [ 'pattern-categories', 'order', 'orderby', 'curation' ];
foreach ( $query_vars as $query_var ) {
if ( ! isset( $wp_query->query[ $query_var ] ) ) {
continue;
Expand Down

0 comments on commit cfa9b11

Please sign in to comment.