I am creating pages for my Partner which display the icons of the portfolio pages completed by that partner. I want the user to be able to sort/limit the portfolio categories according to all of the categories that are associated portfolio that has been selected in the template builder.
For example, I have two profiles on this partner page draft. Health is the portfolio category that I have chosen for any portfolio item associated with this partner, and is woven into the template for this page. These portfolios also have 'Alaskan Native Health Inequities and Disparities', 'HIV/AIDS', and 'Health Disparities' checked as their portfolio category. And I would like those categories to appear on the sort list, but, not to include any portfolio items that don't have 'Health' as a category.
In other words, how do I add to the sortable list, the other categories selected for the profiles that have "Health'? How do I get wordpress to query the portfolio categories for all of the portfolio items that are categorized under 'Health' so that the user can sort them?
This ensures that profiles not created by this partner do not show up on their partner page (they would if I selected the template to include HIV/AIDS for example), while making it possible to sort based on all of the categories present in the portfolios created by this partner.
This would allow me to make the list sortable, without including profiles/portfolios that weren't created by this specific partner.