From cd1ba19e52691fe3c654c1cb48eff80d2c783b10 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 1 Jun 2024 17:37:18 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `wp-includes/post-template.php`. Follow-up to [5017], [5018], [6228], [13494], [15582], [23653], [44941]. Props aristath, poena, afercia, SergeyBiryukov. See #60700. Built from https://develop.svn.wordpress.org/trunk@58277 git-svn-id: http://core.svn.wordpress.org/trunk@57737 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 14 +++++++++----- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 127f2919a1..7b12bf6c4c 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -345,7 +345,9 @@ function get_the_content( $more_link_text = null, $strip_teaser = false, $post = $content = array( $content ); } - if ( str_contains( $_post->post_content, '' ) && ( ! $elements['multipage'] || 1 == $elements['page'] ) ) { + if ( str_contains( $_post->post_content, '' ) + && ( ! $elements['multipage'] || 1 === $elements['page'] ) + ) { $strip_teaser = true; } @@ -978,11 +980,13 @@ function wp_link_pages( $args = '' ) { $output .= $parsed_args['before']; for ( $i = 1; $i <= $numpages; $i++ ) { $link = $parsed_args['link_before'] . str_replace( '%', $i, $parsed_args['pagelink'] ) . $parsed_args['link_after']; - if ( $i != $page || ! $more && 1 == $page ) { + + if ( $i !== $page || ! $more && 1 === $page ) { $link = _wp_link_page( $i ) . $link . ''; } elseif ( $i === $page ) { $link = '' . $link . ''; } + /** * Filters the HTML output of individual page number links. * @@ -1054,12 +1058,12 @@ function _wp_link_page( $i ) { $post = get_post(); $query_args = array(); - if ( 1 == $i ) { + if ( 1 === $i ) { $url = get_permalink(); } else { if ( ! get_option( 'permalink_structure' ) || in_array( $post->post_status, array( 'draft', 'pending' ), true ) ) { $url = add_query_arg( 'page', $i, get_permalink() ); - } elseif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) { + } elseif ( 'page' === get_option( 'show_on_front' ) && (int) get_option( 'page_on_front' ) === $post->ID ) { $url = trailingslashit( get_permalink() ) . user_trailingslashit( "$wp_rewrite->pagination_base/" . $i, 'single_paged' ); } else { $url = trailingslashit( get_permalink() ) . user_trailingslashit( $i, 'single_paged' ); @@ -1815,7 +1819,7 @@ function is_page_template( $template = '' ) { return (bool) $page_template; } - if ( $template == $page_template ) { + if ( $template === $page_template ) { return true; } diff --git a/wp-includes/version.php b/wp-includes/version.php index bac8cf8ff1..e1aaa600aa 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58275'; +$wp_version = '6.6-alpha-58277'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.