I have two custom post types, "participants" and "reports". Both of them are associated with the custom taxonomy "year".
So in the post "report 1" that is flagged under "2023" taxonomy I want to show the number of "participants" that are flagged under the same taxonomy (2023). The "Report 2" is flagged under "2022" taxonomy and it must show the number of "participants" that are flagged under the same taxonomy (2022). And so on.
Whatever I find online, it's always hard coded. But I need it to be dynamic. Any ideas?