Don't use variable variables in get_terms()
.
See #27881. git-svn-id: https://develop.svn.wordpress.org/trunk@28736 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e535d7fe6e
commit
5fe5f8f3ad
@ -1571,9 +1571,13 @@ function get_terms( $taxonomies, $args = '' ) {
|
||||
* @param array $args An array of terms query arguments.
|
||||
*/
|
||||
$clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args );
|
||||
foreach ( $pieces as $piece ) {
|
||||
$$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
|
||||
}
|
||||
$fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
|
||||
$join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
|
||||
$where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
|
||||
$orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
|
||||
$order = isset( $clauses[ 'order' ] ) ? $clauses[ 'order' ] : '';
|
||||
$limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
|
||||
|
||||
$query = "SELECT $fields FROM $wpdb->terms AS t $join WHERE $where $orderby $order $limits";
|
||||
|
||||
if ( 'count' == $_fields ) {
|
||||
|
Loading…
Reference in New Issue
Block a user