From 034de7f1de213ebb5df2da9f3a9edb4e0f3e3fb5 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 15 May 2014 05:42:55 +0000 Subject: [PATCH] Eliminate the use of `extract()` in `get_objects_in_term()`. Only one property (`order`) was extracted. See #22400. git-svn-id: https://develop.svn.wordpress.org/trunk@28423 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 48d49e1866..58dd9cb9f9 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -576,22 +576,22 @@ function unregister_taxonomy_for_object_type( $taxonomy, $object_type ) { function get_objects_in_term( $term_ids, $taxonomies, $args = array() ) { global $wpdb; - if ( ! is_array( $term_ids ) ) + if ( ! is_array( $term_ids ) ) { $term_ids = array( $term_ids ); - - if ( ! is_array( $taxonomies ) ) + } + if ( ! is_array( $taxonomies ) ) { $taxonomies = array( $taxonomies ); - + } foreach ( (array) $taxonomies as $taxonomy ) { - if ( ! taxonomy_exists( $taxonomy ) ) + if ( ! taxonomy_exists( $taxonomy ) ) { return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) ); + } } $defaults = array( 'order' => 'ASC' ); $args = wp_parse_args( $args, $defaults ); - extract( $args, EXTR_SKIP ); - $order = ( 'desc' == strtolower( $order ) ) ? 'DESC' : 'ASC'; + $order = ( 'desc' == strtolower( $args['order'] ) ) ? 'DESC' : 'ASC'; $term_ids = array_map('intval', $term_ids ); @@ -600,9 +600,9 @@ function get_objects_in_term( $term_ids, $taxonomies, $args = array() ) { $object_ids = $wpdb->get_col("SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tt.term_id IN ($term_ids) ORDER BY tr.object_id $order"); - if ( ! $object_ids ) + if ( ! $object_ids ){ return array(); - + } return $object_ids; }