Make WordPress Core

Changeset 31087


Ignore:
Timestamp:
01/08/2015 06:25:40 AM (10 years ago)
Author:
wonderboymusic
Message:

In wp-includes/taxonomy.php:

The keyword elseif should be used instead of else if so that all control keywords look like single words.

See #30799.

File:
1 edited

Legend:

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

    r31035 r31087  
    766766
    767767            // First-order clause.
    768             } else if ( self::is_first_order_clause( $query ) ) {
     768            } elseif ( self::is_first_order_clause( $query ) ) {
    769769
    770770                $cleaned_clause = array_merge( $defaults, $query );
     
    796796
    797797            // Otherwise, it's a nested query, so we recurse.
    798             } else if ( is_array( $query ) ) {
     798            } elseif ( is_array( $query ) ) {
    799799                $cleaned_subquery = $this->sanitize_query( $query );
    800800
     
    940940            if ( 'relation' === $key ) {
    941941                $relation = $query['relation'];
    942             } else if ( is_array( $clause ) ) {
     942            } elseif ( is_array( $clause ) ) {
    943943
    944944                // This is a first-order clause.
     
    949949                    if ( ! $where_count ) {
    950950                        $sql_chunks['where'][] = '';
    951                     } else if ( 1 === $where_count ) {
     951                    } elseif ( 1 === $where_count ) {
    952952                        $sql_chunks['where'][] = $clause_sql['where'][0];
    953953                    } else {
     
    13941394        if ( empty($value) )
    13951395            return false;
    1396     } else if ( 'name' == $field ) {
     1396    } elseif ( 'name' == $field ) {
    13971397        // Assume already escaped
    13981398        $value = wp_unslash($value);
    13991399        $field = 't.name';
    1400     } else if ( 'term_taxonomy_id' == $field ) {
     1400    } elseif ( 'term_taxonomy_id' == $field ) {
    14011401        $value = (int) $value;
    14021402        $field = 'tt.term_taxonomy_id';
     
    17001700    if ( 'count' == $_orderby ) {
    17011701        $orderby = 'tt.count';
    1702     } else if ( 'name' == $_orderby ) {
     1702    } elseif ( 'name' == $_orderby ) {
    17031703        $orderby = 't.name';
    1704     } else if ( 'slug' == $_orderby ) {
     1704    } elseif ( 'slug' == $_orderby ) {
    17051705        $orderby = 't.slug';
    1706     } else if ( 'include' == $_orderby && ! empty( $args['include'] ) ) {
     1706    } elseif ( 'include' == $_orderby && ! empty( $args['include'] ) ) {
    17071707        $include = implode( ',', array_map( 'absint', $args['include'] ) );
    17081708        $orderby = "FIELD( t.term_id, $include )";
    1709     } else if ( 'term_group' == $_orderby ) {
     1709    } elseif ( 'term_group' == $_orderby ) {
    17101710        $orderby = 't.term_group';
    1711     } else if ( 'none' == $_orderby ) {
     1711    } elseif ( 'none' == $_orderby ) {
    17121712        $orderby = '';
    17131713    } elseif ( empty($_orderby) || 'id' == $_orderby ) {
     
    22072207        else
    22082208            $value = esc_attr($value);
    2209     } else if ( 'db' == $context ) {
     2209    } elseif ( 'db' == $context ) {
    22102210
    22112211        /**
     
    22462246        }
    22472247
    2248     } else if ( 'rss' == $context ) {
     2248    } elseif ( 'rss' == $context ) {
    22492249
    22502250        /**
     
    23032303    }
    23042304
    2305     if ( 'attribute' == $context )
     2305    if ( 'attribute' == $context ) {
    23062306        $value = esc_attr($value);
    2307     else if ( 'js' == $context )
     2307    } elseif ( 'js' == $context ) {
    23082308        $value = esc_js($value);
    2309 
     2309    }
    23102310    return $value;
    23112311}
     
    26232623    $fields = $args['fields'];
    26242624
    2625     if ( 'count' == $orderby )
     2625    if ( 'count' == $orderby ) {
    26262626        $orderby = 'tt.count';
    2627     else if ( 'name' == $orderby )
     2627    } elseif ( 'name' == $orderby ) {
    26282628        $orderby = 't.name';
    2629     else if ( 'slug' == $orderby )
     2629    } elseif ( 'slug' == $orderby ) {
    26302630        $orderby = 't.slug';
    2631     else if ( 'term_group' == $orderby )
     2631    } elseif ( 'term_group' == $orderby ) {
    26322632        $orderby = 't.term_group';
    2633     else if ( 'term_order' == $orderby )
     2633    } elseif ( 'term_order' == $orderby ) {
    26342634        $orderby = 'tr.term_order';
    2635     else if ( 'none' == $orderby ) {
     2635    } elseif ( 'none' == $orderby ) {
    26362636        $orderby = '';
    26372637        $order = '';
     
    26552655
    26562656    $select_this = '';
    2657     if ( 'all' == $fields )
     2657    if ( 'all' == $fields ) {
    26582658        $select_this = 't.*, tt.*';
    2659     else if ( 'ids' == $fields )
     2659    } elseif ( 'ids' == $fields ) {
    26602660        $select_this = 't.term_id';
    2661     else if ( 'names' == $fields )
     2661    } elseif ( 'names' == $fields ) {
    26622662        $select_this = 't.name';
    2663     else if ( 'slugs' == $fields )
     2663    } elseif ( 'slugs' == $fields ) {
    26642664        $select_this = 't.slug';
    2665     else if ( 'all_with_object_id' == $fields )
     2665    } elseif ( 'all_with_object_id' == $fields ) {
    26662666        $select_this = 't.*, tt.*, tr.object_id';
    2667 
     2667    }
    26682668    $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN $wpdb->term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tr.object_id IN ($object_ids) $orderby $order";
    26692669
     
    26772677        update_term_cache( $terms );
    26782678        $objects = true;
    2679     } else if ( 'ids' == $fields || 'names' == $fields || 'slugs' == $fields ) {
     2679    } elseif ( 'ids' == $fields || 'names' == $fields || 'slugs' == $fields ) {
    26802680        $_terms = $wpdb->get_col( $query );
    26812681        $_field = ( 'ids' == $fields ) ? 'term_id' : 'name';
     
    26842684        }
    26852685        $terms = array_merge( $terms, $_terms );
    2686     } else if ( 'tt_ids' == $fields ) {
     2686    } elseif ( 'tt_ids' == $fields ) {
    26872687        $terms = $wpdb->get_col("SELECT tr.term_taxonomy_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN ($object_ids) AND tt.taxonomy IN ($taxonomies) $orderby $order");
    26882688        foreach ( $terms as $key => $tt_id ) {
     
    28232823            // The alias we want is already in a group, so let's use that one.
    28242824            $term_group = $alias->term_group;
    2825         } else if ( ! empty( $alias->term_id ) ) {
     2825        } elseif ( ! empty( $alias->term_id ) ) {
    28262826            /*
    28272827             * The alias is not in a group, so we create a new one
     
    33353335            // The alias we want is already in a group, so let's use that one.
    33363336            $term_group = $alias->term_group;
    3337         } else if ( ! empty( $alias->term_id ) ) {
     3337        } elseif ( ! empty( $alias->term_id ) ) {
    33383338            /*
    33393339             * The alias is not in a group, so we create a new one
     
    43304330        if ( is_taxonomy_hierarchical( $object_type ) ) {
    43314331            $resource_type = 'taxonomy';
    4332         } else if ( post_type_exists( $object_type ) ) {
     4332        } elseif ( post_type_exists( $object_type ) ) {
    43334333            $resource_type = 'post_type';
    43344334        }
Note: See TracChangeset for help on using the changeset viewer.