Taxonomy Metadata in get_terms()

* Add term meta to results of get_terms
* See /genesis/lib/functions/options.php for more info
* Genesis is forced to create its own term-meta data structure in
* the options table. Therefore, the following function merges that
* data into the term data structure, via a filter.
* @param array $terms
* @param string $taxonomy Taxonomy name that $terms are part of.
* @param array $args
* @return array $terms
function be_get_terms_filter( $terms, $taxonomy, $args ) {
foreach( $terms as $term )
$term = genesis_get_term_filter( $term, $taxonomy );
return $terms;
add_filter( 'get_terms', 'be_get_terms_filter', 10, 3 );
view raw functions.php hosted with ❤ by GitHub

Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributing developer to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk