<?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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters