Changeset 47808 for trunk/src/wp-includes/class-wp-user-query.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-user-query.php
r47550 r47808 243 243 } 244 244 $this->query_fields = implode( ',', $this->query_fields ); 245 } elseif ( 'all' == $qv['fields'] ) {245 } elseif ( 'all' === $qv['fields'] ) { 246 246 $this->query_fields = "$wpdb->users.*"; 247 247 } else { … … 321 321 $this->meta_query->parse_query_vars( $qv ); 322 322 323 if ( isset( $qv['who'] ) && 'authors' == $qv['who'] && $blog_id ) {323 if ( isset( $qv['who'] ) && 'authors' === $qv['who'] && $blog_id ) { 324 324 $who_query = array( 325 325 'key' => $wpdb->get_blog_prefix( $blog_id ) . 'user_level', … … 615 615 $this->request = "SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit"; 616 616 617 if ( is_array( $qv['fields'] ) || 'all' == $qv['fields'] ) {617 if ( is_array( $qv['fields'] ) || 'all' === $qv['fields'] ) { 618 618 $this->results = $wpdb->get_results( $this->request ); 619 619 } else { … … 643 643 } 644 644 645 if ( 'all_with_meta' == $qv['fields'] ) {645 if ( 'all_with_meta' === $qv['fields'] ) { 646 646 cache_users( $this->results ); 647 647 … … 652 652 653 653 $this->results = $r; 654 } elseif ( 'all' == $qv['fields'] ) {654 } elseif ( 'all' === $qv['fields'] ) { 655 655 foreach ( $this->results as $key => $user ) { 656 656 $this->results[ $key ] = new WP_User( $user, '', $qv['blog_id'] ); … … 704 704 705 705 $searches = array(); 706 $leading_wild = ( 'leading' == $wild || 'both'== $wild ) ? '%' : '';707 $trailing_wild = ( 'trailing' == $wild || 'both'== $wild ) ? '%' : '';706 $leading_wild = ( 'leading' === $wild || 'both' === $wild ) ? '%' : ''; 707 $trailing_wild = ( 'trailing' === $wild || 'both' === $wild ) ? '%' : ''; 708 708 $like = $leading_wild . $wpdb->esc_like( $string ) . $trailing_wild; 709 709 710 710 foreach ( $cols as $col ) { 711 if ( 'ID' == $col ) {711 if ( 'ID' === $col ) { 712 712 $searches[] = $wpdb->prepare( "$col = %s", $string ); 713 713 } else { … … 761 761 } elseif ( in_array( $orderby, array( 'user_login', 'user_nicename', 'user_email', 'user_url', 'user_registered' ), true ) ) { 762 762 $_orderby = $orderby; 763 } elseif ( 'name' == $orderby || 'display_name'== $orderby ) {763 } elseif ( 'name' === $orderby || 'display_name' === $orderby ) { 764 764 $_orderby = 'display_name'; 765 } elseif ( 'post_count' == $orderby ) {765 } elseif ( 'post_count' === $orderby ) { 766 766 // @todo Avoid the JOIN. 767 767 $where = get_posts_by_author_sql( 'post' ); … … 774 774 "; 775 775 $_orderby = 'post_count'; 776 } elseif ( 'ID' == $orderby || 'id'== $orderby ) {776 } elseif ( 'ID' === $orderby || 'id' === $orderby ) { 777 777 $_orderby = 'ID'; 778 } elseif ( 'meta_value' == $orderby || $this->get( 'meta_key' ) == $orderby ) {778 } elseif ( 'meta_value' === $orderby || $this->get( 'meta_key' ) == $orderby ) { 779 779 $_orderby = "$wpdb->usermeta.meta_value"; 780 } elseif ( 'meta_value_num' == $orderby ) {780 } elseif ( 'meta_value_num' === $orderby ) { 781 781 $_orderby = "$wpdb->usermeta.meta_value+0"; 782 782 } elseif ( 'include' === $orderby && ! empty( $this->query_vars['include'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.