Skip to content

Commit acacac3

Browse files
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: https://core.svn.wordpress.org/trunk@57737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent c839fde commit acacac3

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

wp-includes/post-template.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ function get_the_content( $more_link_text = null, $strip_teaser = false, $post =
345345
$content = array( $content );
346346
}
347347

348-
if ( str_contains( $_post->post_content, '<!--noteaser-->' ) && ( ! $elements['multipage'] || 1 == $elements['page'] ) ) {
348+
if ( str_contains( $_post->post_content, '<!--noteaser-->' )
349+
&& ( ! $elements['multipage'] || 1 === $elements['page'] )
350+
) {
349351
$strip_teaser = true;
350352
}
351353

@@ -978,11 +980,13 @@ function wp_link_pages( $args = '' ) {
978980
$output .= $parsed_args['before'];
979981
for ( $i = 1; $i <= $numpages; $i++ ) {
980982
$link = $parsed_args['link_before'] . str_replace( '%', $i, $parsed_args['pagelink'] ) . $parsed_args['link_after'];
981-
if ( $i != $page || ! $more && 1 == $page ) {
983+
984+
if ( $i !== $page || ! $more && 1 === $page ) {
982985
$link = _wp_link_page( $i ) . $link . '</a>';
983986
} elseif ( $i === $page ) {
984987
$link = '<span class="post-page-numbers current" aria-current="' . esc_attr( $parsed_args['aria_current'] ) . '">' . $link . '</span>';
985988
}
989+
986990
/**
987991
* Filters the HTML output of individual page number links.
988992
*
@@ -1054,12 +1058,12 @@ function _wp_link_page( $i ) {
10541058
$post = get_post();
10551059
$query_args = array();
10561060

1057-
if ( 1 == $i ) {
1061+
if ( 1 === $i ) {
10581062
$url = get_permalink();
10591063
} else {
10601064
if ( ! get_option( 'permalink_structure' ) || in_array( $post->post_status, array( 'draft', 'pending' ), true ) ) {
10611065
$url = add_query_arg( 'page', $i, get_permalink() );
1062-
} elseif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {
1066+
} elseif ( 'page' === get_option( 'show_on_front' ) && (int) get_option( 'page_on_front' ) === $post->ID ) {
10631067
$url = trailingslashit( get_permalink() ) . user_trailingslashit( "$wp_rewrite->pagination_base/" . $i, 'single_paged' );
10641068
} else {
10651069
$url = trailingslashit( get_permalink() ) . user_trailingslashit( $i, 'single_paged' );
@@ -1815,7 +1819,7 @@ function is_page_template( $template = '' ) {
18151819
return (bool) $page_template;
18161820
}
18171821

1818-
if ( $template == $page_template ) {
1822+
if ( $template === $page_template ) {
18191823
return true;
18201824
}
18211825

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.6-alpha-58275';
19+
$wp_version = '6.6-alpha-58277';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)