{post_terms_category} but for IDs?

I want to get a list of posts that are related to the current one by a shared custom taxonomy. This can be done using a Query Loop with a Taxonomy Query - field: name, terms: {post_terms_my_taxonomy} but this breaks when the term name contains a comma. This feels like a situation where IDs would be better suited and it seems strange that this isn’t a dynamic tag. Am I missing something here, or do I need to echo a custom function for this? It seems like such a basic need I’m surprised there isn’t a native way of doing it?

1 Like