Coding Standards: Use strict comparison in `wp-includes/link-template.php`.
Follow-up to [4475], [6365], [8706], [9296], [9318], [14141], [15819], [21364], [27802]. Props aristath, poena, afercia, SergeyBiryukov. See #60700. Built from https://develop.svn.wordpress.org/trunk@57867 git-svn-id: http://core.svn.wordpress.org/trunk@57368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
24ad060351
commit
d28dd189b8
|
@ -391,7 +391,7 @@ function get_post_permalink( $post = 0, $leavename = false, $sample = false ) {
|
||||||
function get_page_link( $post = false, $leavename = false, $sample = false ) {
|
function get_page_link( $post = false, $leavename = false, $sample = false ) {
|
||||||
$post = get_post( $post );
|
$post = get_post( $post );
|
||||||
|
|
||||||
if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) {
|
if ( 'page' === get_option( 'show_on_front' ) && (int) get_option( 'page_on_front' ) === $post->ID ) {
|
||||||
$link = home_url( '/' );
|
$link = home_url( '/' );
|
||||||
} else {
|
} else {
|
||||||
$link = _get_page_link( $post, $leavename, $sample );
|
$link = _get_page_link( $post, $leavename, $sample );
|
||||||
|
@ -701,7 +701,7 @@ function get_feed_link( $feed = '' ) {
|
||||||
$permalink = $wp_rewrite->get_comment_feed_permastruct();
|
$permalink = $wp_rewrite->get_comment_feed_permastruct();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( get_default_feed() == $feed ) {
|
if ( get_default_feed() === $feed ) {
|
||||||
$feed = '';
|
$feed = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -763,7 +763,7 @@ function get_post_comments_feed_link( $post_id = 0, $feed = '' ) {
|
||||||
$unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent;
|
$unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent;
|
||||||
|
|
||||||
if ( get_option( 'permalink_structure' ) ) {
|
if ( get_option( 'permalink_structure' ) ) {
|
||||||
if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post_id ) {
|
if ( 'page' === get_option( 'show_on_front' ) && (int) get_option( 'page_on_front' ) === $post_id ) {
|
||||||
$url = _get_page_link( $post_id );
|
$url = _get_page_link( $post_id );
|
||||||
} else {
|
} else {
|
||||||
$url = get_permalink( $post_id );
|
$url = get_permalink( $post_id );
|
||||||
|
@ -777,7 +777,7 @@ function get_post_comments_feed_link( $post_id = 0, $feed = '' ) {
|
||||||
$url = add_query_arg( 'attachment_id', $post_id, $url );
|
$url = add_query_arg( 'attachment_id', $post_id, $url );
|
||||||
} else {
|
} else {
|
||||||
$url = trailingslashit( $url ) . 'feed';
|
$url = trailingslashit( $url ) . 'feed';
|
||||||
if ( get_default_feed() != $feed ) {
|
if ( get_default_feed() !== $feed ) {
|
||||||
$url .= "/$feed";
|
$url .= "/$feed";
|
||||||
}
|
}
|
||||||
$url = user_trailingslashit( $url, 'single_feed' );
|
$url = user_trailingslashit( $url, 'single_feed' );
|
||||||
|
@ -879,7 +879,7 @@ function get_author_feed_link( $author_id, $feed = '' ) {
|
||||||
$link = home_url( "?feed=$feed&author=" . $author_id );
|
$link = home_url( "?feed=$feed&author=" . $author_id );
|
||||||
} else {
|
} else {
|
||||||
$link = get_author_posts_url( $author_id );
|
$link = get_author_posts_url( $author_id );
|
||||||
if ( get_default_feed() == $feed ) {
|
if ( get_default_feed() === $feed ) {
|
||||||
$feed_link = 'feed';
|
$feed_link = 'feed';
|
||||||
} else {
|
} else {
|
||||||
$feed_link = "feed/$feed";
|
$feed_link = "feed/$feed";
|
||||||
|
@ -962,7 +962,7 @@ function get_term_feed_link( $term, $taxonomy = '', $feed = '' ) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$link = get_term_link( $term, $term->taxonomy );
|
$link = get_term_link( $term, $term->taxonomy );
|
||||||
if ( get_default_feed() == $feed ) {
|
if ( get_default_feed() === $feed ) {
|
||||||
$feed_link = 'feed';
|
$feed_link = 'feed';
|
||||||
} else {
|
} else {
|
||||||
$feed_link = "feed/$feed";
|
$feed_link = "feed/$feed";
|
||||||
|
@ -1374,7 +1374,7 @@ function get_post_type_archive_feed_link( $post_type, $feed = '' ) {
|
||||||
if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) {
|
if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) {
|
||||||
$link = trailingslashit( $link );
|
$link = trailingslashit( $link );
|
||||||
$link .= 'feed/';
|
$link .= 'feed/';
|
||||||
if ( $feed != $default_feed ) {
|
if ( $feed !== $default_feed ) {
|
||||||
$link .= "$feed/";
|
$link .= "$feed/";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1737,7 +1737,7 @@ function get_edit_user_link( $user_id = null ) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( get_current_user_id() == $user->ID ) {
|
if ( get_current_user_id() === $user->ID ) {
|
||||||
$link = get_edit_profile_url( $user->ID );
|
$link = get_edit_profile_url( $user->ID );
|
||||||
} else {
|
} else {
|
||||||
$link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
|
$link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
|
||||||
|
@ -3057,11 +3057,12 @@ function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {
|
||||||
global $wp_rewrite;
|
global $wp_rewrite;
|
||||||
|
|
||||||
$pagenum = (int) $pagenum;
|
$pagenum = (int) $pagenum;
|
||||||
|
$max_page = (int) $max_page;
|
||||||
|
|
||||||
$result = get_permalink();
|
$result = get_permalink();
|
||||||
|
|
||||||
if ( 'newest' === get_option( 'default_comments_page' ) ) {
|
if ( 'newest' === get_option( 'default_comments_page' ) ) {
|
||||||
if ( $pagenum != $max_page ) {
|
if ( $pagenum !== $max_page ) {
|
||||||
if ( $wp_rewrite->using_permalinks() ) {
|
if ( $wp_rewrite->using_permalinks() ) {
|
||||||
$result = user_trailingslashit( trailingslashit( $result ) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged' );
|
$result = user_trailingslashit( trailingslashit( $result ) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged' );
|
||||||
} else {
|
} else {
|
||||||
|
@ -4154,7 +4155,9 @@ function wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) {
|
||||||
if ( ! empty( $post_id ) ) {
|
if ( ! empty( $post_id ) ) {
|
||||||
$post_type = get_post_type_object( $post->post_type );
|
$post_type = get_post_type_object( $post->post_type );
|
||||||
|
|
||||||
if ( 'page' === $post->post_type && get_option( 'page_on_front' ) == $post->ID && 'page' === get_option( 'show_on_front' ) ) {
|
if ( 'page' === $post->post_type
|
||||||
|
&& 'page' === get_option( 'show_on_front' ) && (int) get_option( 'page_on_front' ) === $post->ID
|
||||||
|
) {
|
||||||
$shortlink = home_url( '/' );
|
$shortlink = home_url( '/' );
|
||||||
} elseif ( $post_type && $post_type->public ) {
|
} elseif ( $post_type && $post_type->public ) {
|
||||||
$shortlink = home_url( '?p=' . $post_id );
|
$shortlink = home_url( '?p=' . $post_id );
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.6-alpha-57865';
|
$wp_version = '6.6-alpha-57867';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue