Make WordPress Core

Changeset 28423


Ignore:
Timestamp:
05/15/2014 05:42:55 AM (12 years ago)
Author:
wonderboymusic
Message:

Eliminate the use of extract() in get_objects_in_term(). Only one property (order) was extracted.

See #22400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r28422 r28423  
    577577        global $wpdb;
    578578
    579         if ( ! is_array( $term_ids ) )
     579        if ( ! is_array( $term_ids ) ) {
    580580                $term_ids = array( $term_ids );
    581 
    582         if ( ! is_array( $taxonomies ) )
     581        }
     582        if ( ! is_array( $taxonomies ) ) {
    583583                $taxonomies = array( $taxonomies );
    584 
     584        }
    585585        foreach ( (array) $taxonomies as $taxonomy ) {
    586                 if ( ! taxonomy_exists( $taxonomy ) )
     586                if ( ! taxonomy_exists( $taxonomy ) ) {
    587587                        return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy' ) );
     588                }
    588589        }
    589590
    590591        $defaults = array( 'order' => 'ASC' );
    591592        $args = wp_parse_args( $args, $defaults );
    592         extract( $args, EXTR_SKIP );
    593 
    594         $order = ( 'desc' == strtolower( $order ) ) ? 'DESC' : 'ASC';
     593
     594        $order = ( 'desc' == strtolower( $args['order'] ) ) ? 'DESC' : 'ASC';
    595595
    596596        $term_ids = array_map('intval', $term_ids );
    … …  
    601601        $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");
    602602
    603         if ( ! $object_ids )
     603        if ( ! $object_ids ){
    604604                return array();
    605 
     605        }
    606606        return $object_ids;
    607607}
Note: See TracChangeset for help on using the changeset viewer.