Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in `_reset_front_page_setting…
Browse files Browse the repository at this point in the history
…s_for_post()`.

Follow-up to [6337], [25686].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

git-svn-id: https://develop.svn.wordpress.org/trunk@59572 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jan 2, 2025
1 parent 7bd6835 commit 016bbec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -3859,11 +3859,11 @@ function _reset_front_page_settings_for_post( $post_id ) {
* If the page is defined in option page_on_front or post_for_posts,
* adjust the corresponding options.
*/
if ( get_option( 'page_on_front' ) == $post->ID ) {
if ( (int) get_option( 'page_on_front' ) === $post->ID ) {
update_option( 'show_on_front', 'posts' );
update_option( 'page_on_front', 0 );
}
if ( get_option( 'page_for_posts' ) == $post->ID ) {
if ( (int) get_option( 'page_for_posts' ) === $post->ID ) {
update_option( 'page_for_posts', 0 );
}
}
Expand Down

0 comments on commit 016bbec

Please sign in to comment.