wp_get_object_terms() to get a list of all the terms attached to all the posts in the current query

I think you’re on the right track because wp_get_object_terms() can take an array of IDs for its first argument, it’s just that $wp_query is not the array you want. I can’t guarantee that this is more efficient (not my area of expertise), but I believe this [partially-tested] snippet would do what you want with at … Read more

Filter posts by multiple custom taxonomy terms using AND operator in REST API v2 (WordPress)

I think I know the fix. I noticed that the plus sign (+) in the url arguments was automatically being stripped and converted into a space. My arg values ‘august+september’ were becoming ‘august september’ after decoding. I found out that ‘%2B’ is the code equivalent of the + symbol. So, instead of using: /wp-json/wp/v2/events?filter[event_categories]=august+september Use: … Read more

Using multiple taxonomies to sort Custom Posts

Part of your trouble likely stems from the fact that you’re using the legacy version of the get_terms() function. As per the docs for this function: Since 4.5.0, taxonomies should be passed via the ‘taxonomy’ argument in the $args array: $terms = get_terms( array( ‘taxonomy’ => ‘post_tag’, ‘hide_empty’ => false, ) ); Therefore, we can … Read more

How to add images to taxonomies?

Starting from WordPress 4.4, you can use add_term_meta function to store metadata for a term. This is basically a key-value pair information which is stored in wp_termmeta table. Original Answer(Prior to WP 4.4) WordPress doesn’t have the option to add extra information to taxonomies. There isn’t any taxonomy_meta table. So, you have two options. Create … Read more