jjgrainger / PostTypes

Simple WordPress custom post types.
https://posttypes.jjgrainger.co.uk/
MIT License
372 stars 48 forks source link

post_tag Filter not working #92

Open davidmondok opened 1 year ago

davidmondok commented 1 year ago

When I add post_tag taxonomy support to a custom post type via ->taxonomy("post_tag") a select filter will automatically be added to that post types edit.php All Posts dashboard page.

However, the filter doesn't work. This only happens specifically for Wordpress's post_tag taxonomy. Select filters for all custom taxonomies work as expected.

Maybe you/someone has a quick answer or idea, why this is happening. But I'll try to find the time to debug this issue otherwise. Thanks :)

PHP Version: 7.4 WordPress: 6.1.1 jjgrainger/posttypes: 2.2

jjgrainger commented 1 month ago

Thanks @davidmondok

I believe the issue is caused by using the taxonomy name post_tag for the field name (PostType.php#L430), when the query var needed is tag.

I was working on a fix but making the changes needed here caused another issue where the filtering did not work with other taxonomies. I need to investigate this further.