Created
February 17, 2015 18:30
-
-
Save joehoyle/d524e91ae7754fa0680a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function hm_add_term_meta_query_support( $pieces, $taxonomies, $args ) { | |
| if ( empty( $args['meta_query'] ) ) { | |
| return $pieces; | |
| } | |
| $meta_query = new WP_Meta_Query( $args['meta_query'] ); | |
| $sql = $meta_query->get_sql( 'term', 't', 'term_id' ); | |
| if ( ! $sql ) { | |
| return $pieces; | |
| } | |
| $pieces['join'] .= $sql['join']; | |
| $pieces['where'] .= $sql['where']; | |
| return $pieces; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: