Changeset 47219 for trunk/src/wp-includes/class-wp-query.php
- Timestamp:
- 02/09/2020 04:52:28 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-query.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r47181 r47219 911 911 unset( $tax_query ); 912 912 913 if ( empty( $qv['author'] ) || ( $qv['author'] == '0') ) {913 if ( empty( $qv['author'] ) || ( '0' == $qv['author'] ) ) { 914 914 $this->is_author = false; 915 915 } else { … … 1018 1018 } 1019 1019 1020 if ( 'page' == get_option( 'show_on_front' ) && isset( $this->queried_object_id ) && $this->queried_object_id == get_option( 'page_for_posts' )) {1020 if ( 'page' === get_option( 'show_on_front' ) && isset( $this->queried_object_id ) && get_option( 'page_for_posts' ) == $this->queried_object_id ) { 1021 1021 $this->is_page = false; 1022 1022 $this->is_home = true; … … 1024 1024 } 1025 1025 1026 if ( isset( $this->queried_object_id ) && $this->queried_object_id == get_option( 'wp_page_for_privacy_policy' )) {1026 if ( isset( $this->queried_object_id ) && get_option( 'wp_page_for_privacy_policy' ) == $this->queried_object_id ) { 1027 1027 $this->is_privacy_policy = true; 1028 1028 } … … 1030 1030 1031 1031 if ( $qv['page_id'] ) { 1032 if ( 'page' == get_option( 'show_on_front' ) && $qv['page_id'] == get_option( 'page_for_posts' )) {1032 if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == $qv['page_id'] ) { 1033 1033 $this->is_page = false; 1034 1034 $this->is_home = true; … … 1036 1036 } 1037 1037 1038 if ( $qv['page_id'] == get_option( 'wp_page_for_privacy_policy' )) {1038 if ( get_option( 'wp_page_for_privacy_policy' ) == $qv['page_id'] ) { 1039 1039 $this->is_privacy_policy = true; 1040 1040 } … … 1378 1378 foreach ( $q['search_terms'] as $term ) { 1379 1379 // If there is an $exclusion_prefix, terms prefixed with it should be excluded. 1380 $exclude = $exclusion_prefix && ( $exclusion_prefix === substr( $term, 0, 1 ));1380 $exclude = $exclusion_prefix && ( substr( $term, 0, 1 ) === $exclusion_prefix ); 1381 1381 if ( $exclude ) { 1382 1382 $like_op = 'NOT LIKE'; … … 1862 1862 $q['posts_per_page'] = $q['showposts']; 1863 1863 } 1864 if ( ( isset( $q['posts_per_archive_page'] ) && $q['posts_per_archive_page'] != 0) && ( $this->is_archive || $this->is_search ) ) {1864 if ( ( isset( $q['posts_per_archive_page'] ) && 0 != $q['posts_per_archive_page'] ) && ( $this->is_archive || $this->is_search ) ) { 1865 1865 $q['posts_per_page'] = $q['posts_per_archive_page']; 1866 1866 } 1867 1867 if ( ! isset( $q['nopaging'] ) ) { 1868 if ( $q['posts_per_page'] == -1) {1868 if ( -1 == $q['posts_per_page'] ) { 1869 1869 $q['nopaging'] = true; 1870 1870 } else { … … 1885 1885 if ( $q['posts_per_page'] < -1 ) { 1886 1886 $q['posts_per_page'] = abs( $q['posts_per_page'] ); 1887 } elseif ( $q['posts_per_page'] == 0) {1887 } elseif ( 0 == $q['posts_per_page'] ) { 1888 1888 $q['posts_per_page'] = 1; 1889 1889 } 1890 1890 1891 if ( ! isset( $q['comments_per_page'] ) || $q['comments_per_page'] == 0) {1891 if ( ! isset( $q['comments_per_page'] ) || 0 == $q['comments_per_page'] ) { 1892 1892 $q['comments_per_page'] = get_option( 'comments_per_page' ); 1893 1893 } 1894 1894 1895 if ( $this->is_home && ( empty( $this->query ) || $q['preview'] == 'true' ) && ( 'page'== get_option( 'show_on_front' ) ) && get_option( 'page_on_front' ) ) {1895 if ( $this->is_home && ( empty( $this->query ) || 'true' === $q['preview'] ) && ( 'page' === get_option( 'show_on_front' ) ) && get_option( 'page_on_front' ) ) { 1896 1896 $this->is_page = true; 1897 1897 $this->is_home = false; … … 2097 2097 2098 2098 if ( $q['page_id'] ) { 2099 if ( ( 'page' != get_option( 'show_on_front' ) ) || ( $q['page_id'] != get_option( 'page_for_posts' )) ) {2099 if ( ( 'page' !== get_option( 'show_on_front' ) ) || ( get_option( 'page_for_posts' ) != $q['page_id'] ) ) { 2100 2100 $q['p'] = $q['page_id']; 2101 2101 $where = " AND {$wpdb->posts}.ID = " . $q['page_id']; … … 2136 2136 $taxonomies = array_keys( $this->tax_query->queried_terms ); 2137 2137 foreach ( get_post_types( array( 'exclude_from_search' => false ) ) as $pt ) { 2138 $object_taxonomies = $pt === 'attachment'? get_taxonomies_for_attachments() : get_object_taxonomies( $pt );2138 $object_taxonomies = 'attachment' === $pt ? get_taxonomies_for_attachments() : get_object_taxonomies( $pt ); 2139 2139 if ( array_intersect( $taxonomies, $object_taxonomies ) ) { 2140 2140 $post_type[] = $pt; … … 2215 2215 // Author/user stuff. 2216 2216 2217 if ( ! empty( $q['author'] ) && $q['author'] != '0') {2217 if ( ! empty( $q['author'] ) && '0' != $q['author'] ) { 2218 2218 $q['author'] = addslashes_gpc( '' . urldecode( $q['author'] ) ); 2219 2219 $authors = array_unique( array_map( 'intval', preg_split( '/[,\s]+/', $q['author'] ) ) ); … … 3291 3291 $this->in_the_loop = true; 3292 3292 3293 if ( $this->current_post == -1) { // Loop has just started.3293 if ( -1 == $this->current_post ) { // Loop has just started. 3294 3294 /** 3295 3295 * Fires once the loop is started. … … 3381 3381 $comment = $this->next_comment(); 3382 3382 3383 if ( $this->current_comment == 0) {3383 if ( 0 == $this->current_comment ) { 3384 3384 /** 3385 3385 * Fires once the comment loop is started. … … 4301 4301 * or when on an RSS feed. Otherwise respect the 'more' tag. 4302 4302 */ 4303 if ( $post->ID === get_queried_object_id()&& ( $this->is_page() || $this->is_single() ) ) {4303 if ( get_queried_object_id() === $post->ID && ( $this->is_page() || $this->is_single() ) ) { 4304 4304 $more = 1; 4305 4305 } elseif ( $this->is_feed() ) {
Note: See TracChangeset
for help on using the changeset viewer.