Skip to content

Instantly share code, notes, and snippets.


billerickson/functions.php Secret

Last active Dec 14, 2015
What would you like to do?
* 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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment