Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active December 14, 2015 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/cf51eda621bdee5698d0 to your computer and use it in GitHub Desktop.
Save billerickson/cf51eda621bdee5698d0 to your computer and use it in GitHub Desktop.
<?php
/**
* 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