Don't use variable variables in `get_terms()`.
See #27881. Built from https://develop.svn.wordpress.org/trunk@28736 git-svn-id: http://core.svn.wordpress.org/trunk@28550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
66bcd85529
commit
17b17d1c78
|
@ -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