Make WordPress Core

Opened 3 years ago

#55748 new defect (bug)

wp_query post_type taxonomies doesn't accept array in url if hierarchical

Reported by: dg12345's profile dg12345 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 5.9.3
Component: Query Keywords:
Focuses: Cc:

Description

if you put the custom taxonomy in the url with an array value
i.e. ?custom_tax[]=term-1&custom_tax[]=term-2
it should filter by those terms

however if you look at the code for wp_query if the taxonomy is hierarchical it is put through wp_basename which cannot process arrays and so the input is completely lost

https://github.com/WordPress/WordPress/blob/102004b50565c767390328aef2357a235d60b026/wp-includes/class-wp-query.php#L1131-L1151

to resolve either we need to move the if(is_array()) above the wp_basename if or make wp_basename accept arrays

Change History (0)

Note: See TracTickets for help on using tickets.