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
This commit is contained in:
Scott Taylor 2014-05-15 05:42:55 +00:00
parent e00ce3ae95
commit 034de7f1de
1 changed files with 9 additions and 9 deletions

View File

@ -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;
}