Skip to content

Commit f4dfb44

Browse files
add feedback of mukesh
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
1 parent e391d36 commit f4dfb44

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/wp-includes/post.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4039,11 +4039,13 @@ function _reset_front_page_settings_for_post( $post_id ) {
40394039
*/
40404040
function _reset_privacy_policy_page_for_post( int $post_id ): void {
40414041
$post = get_post( $post_id );
4042+
4043+
if ( ! $post ) {
4044+
return;
4045+
}
40424046

4043-
if ( $post && 'page' === $post->post_type ) {
4044-
if ( (int) get_option( 'wp_page_for_privacy_policy' ) === (int) $post_id ) {
4045-
update_option( 'wp_page_for_privacy_policy', 0 );
4046-
}
4047+
if ( 'page' === $post->post_type && ( (int) get_option( 'wp_page_for_privacy_policy' ) === (int) $post_id ) {
4048+
update_option( 'wp_page_for_privacy_policy', 0 );
40474049
}
40484050
}
40494051

0 commit comments

Comments
 (0)