Is there a way to encode custom taxonomy and term as query variables in URL? I need it for my custom table derived from WP_List_Table, where I construct links to filter according to terms.

For example, when I click category Uncategorized in post list, I get those variables encoded in URL ending in category_name=uncategorized.

For my case, custom taxonomy is event-categories and term id is 18.

It is encoded in WP_Query as

WP_Query(['tax_query' => [['taxonomy'=>'event-category', 'terms' => 18]]])


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.