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
This commit is contained in:
Sergey Biryukov 2019-08-05 07:43:52 +00:00
parent 82d7870fe4
commit 89c1d393b2

View File

@ -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 );