This filter allows you to modify the arguments that are used to create the category dropdown.
You can, for example, use it to select a different default item, change the “any” text, and make it show the number of locations that each category holds after the category name.
These are the default values that are used:
$args - (array) The default dropdown arguments.
This code example includes the post count after each category in the dropdown:
This one shows how to sort the category items by ID. So the oldest category will show first, and the latest one last:
If you want to change the text used for the default dropdown item, then the code below shows you how to do this:
You can also hide the default dropdown item completely with the code below.
Setting a different category as the selected one can be done with the code below:
Restrict the shown options on each page to a specific parent category:
Only show the child categories from a specific parent category on a page called ‘wpsl’:
You can find the ID’s of your own categories on the Store Locator > Store Categories page. Open the category you want to set as selectedÂ and look for tag_ID in the url. The number behind it is the ID you should use it instead of 1 as in the example above.
You can see the full list of arguments you can use here.
This filter is located in /frontend/class-frontend.php