Make WordPress Core


Ignore:
Timestamp:
07/02/2019 11:41:16 PM (5 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.

See #47632.

File:
1 edited

Legend:

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

    r45362 r45590  
    14041404        $else_where_fields[] = $taxonomy;
    14051405
    1406         if ( $result = $wpdb->get_row( $wpdb->prepare( "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s $orderby $limit", $where_fields ), ARRAY_A ) ) {
     1406        $result = $wpdb->get_row( $wpdb->prepare( "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s $orderby $limit", $where_fields ), ARRAY_A );
     1407        if ( $result ) {
    14071408            return $result;
    14081409        }
     
    14111412    }
    14121413
    1413     if ( $result = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms as t WHERE $where $orderby $limit", $where_fields ) ) ) {
     1414    $result = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms as t WHERE $where $orderby $limit", $where_fields ) );
     1415    if ( $result ) {
    14141416        return $result;
    14151417    }
     
    17511753    $term = (int) $term;
    17521754
    1753     if ( ! $ids = term_exists( $term, $taxonomy ) ) {
     1755    $ids = term_exists( $term, $taxonomy );
     1756    if ( ! $ids ) {
    17541757        return false;
    17551758    }
     
    24492452        }
    24502453
    2451         if ( ! $term_info = term_exists( $term, $taxonomy ) ) {
     2454        $term_info = term_exists( $term, $taxonomy );
     2455        if ( ! $term_info ) {
    24522456            // Skip if a non-existent term ID is passed.
    24532457            if ( is_int( $term ) ) {
     
    26082612        }
    26092613
    2610         if ( ! $term_info = term_exists( $term, $taxonomy ) ) {
     2614        $term_info = term_exists( $term, $taxonomy );
     2615        if ( ! $term_info ) {
    26112616            // Skip if a non-existent term ID is passed.
    26122617            if ( is_int( $term ) ) {
     
    35443549            $ancestors[ $term->term_id ] = 1;
    35453550
    3546             if ( $children = _get_term_children( $term->term_id, $terms, $taxonomy, $ancestors ) ) {
     3551            $children = _get_term_children( $term->term_id, $terms, $taxonomy, $ancestors );
     3552            if ( $children ) {
    35473553                $term_list = array_merge( $term_list, $children );
    35483554            }
     
    36813687    $object_types = array_unique( $object_types );
    36823688
    3683     if ( false !== ( $check_attachments = array_search( 'attachment', $object_types ) ) ) {
     3689    $check_attachments = array_search( 'attachment', $object_types );
     3690    if ( false !== $check_attachments ) {
    36843691        unset( $object_types[ $check_attachments ] );
    36853692        $check_attachments = true;
     
    39493956    // Split term data recording is slow, so we do it just once, outside the loop.
    39503957    $split_term_data    = get_option( '_split_terms', array() );
    3951     $skipped_first_term = $taxonomies = array();
     3958    $skipped_first_term = array();
     3959    $taxonomies         = array();
    39523960    foreach ( $shared_tts as $shared_tt ) {
    39533961        $term_id = intval( $shared_tt->term_id );
     
    43864394 */
    43874395function is_object_in_term( $object_id, $taxonomy, $terms = null ) {
    4388     if ( ! $object_id = (int) $object_id ) {
     4396    $object_id = (int) $object_id;
     4397    if ( ! $object_id ) {
    43894398        return new WP_Error( 'invalid_object', __( 'Invalid object ID.' ) );
    43904399    }
     
    44124421    $terms = (array) $terms;
    44134422
    4414     if ( $ints = array_filter( $terms, 'is_int' ) ) {
     4423    $ints = array_filter( $terms, 'is_int' );
     4424    if ( $ints ) {
    44154425        $strs = array_diff( $terms, $ints );
    44164426    } else {
     
    45594569
    45604570    // Now look for larger loops.
    4561     if ( ! $loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent, array( $taxonomy ) ) ) {
     4571    $loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent, array( $taxonomy ) );
     4572    if ( ! $loop ) {
    45624573        return $parent; // No loop
    45634574    }
Note: See TracChangeset for help on using the changeset viewer.