From 89c1d393b2d395fde9b3ba10e9cd842b5747529a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 5 Aug 2019 07:43:52 +0000 Subject: [PATCH] Posts, Post Types: Update, not delete the `page_for_posts` option in `_reset_front_page_settings_for_post()` when a linked page is deleted or trashed. Props diddledan. Fixes #46850. git-svn-id: https://develop.svn.wordpress.org/trunk@45746 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 88d74a6bc9..ae688a3470 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3000,7 +3000,7 @@ function _reset_front_page_settings_for_post( $post_id ) { update_option( 'page_on_front', 0 ); } if ( get_option( 'page_for_posts' ) == $post->ID ) { - delete_option( 'page_for_posts', 0 ); + update_option( 'page_for_posts', 0 ); } } unstick_post( $post->ID );