Is there a way to get a list of categories where a user is involved (e.g.: posted, replied, voted, etc.)?
-
I'm looking to build a page with the categories where the user is involved somehow, by posting, replying or doing something else additionally, pretty much like the watch feature on Jira, when you do an action related to a Jira ticket.
Is there an easy way to do this without looping through all the categories and topics to check for user activity?
If not, would someone have a suggestion as to what is the best approach to create this list, say, as a plugin?
Thanks in advance,
-
A list of categories or a list of topics?
-
@pitaj Thanks for replying, I'm looking for a list of categories, i.e. all the categories which include topics where the user been involved.
Currently I can potentially do this by fetching all the posts via the API and get their corresponding categories, but this seems counter-intuitive and requires looping so it might be very consumptive I reckon.
-
You would have to iterate through all existing posts to create an initial table, but after that you can use the
action:post.save
hook to listen for new posts and add those to the table as they're created.