Group custom posts by custom taxonomy names
You should write it as the following: $term_ids = array_map( function( $t ) { return $t->term_id ; }, $terms ); Also in the code, you have the get_terms where you directly write the taxonomy name. This has been deprecated in favor of the following : $terms = get_terms( array( ‘taxonomy’ => ‘event-categories’, ‘hide_empty’ => false, … Read more