Ticket #5361: 569_show_on_front.diff
| File 569_show_on_front.diff, 842 bytes (added by hailin, 5 years ago) |
|---|
-
wp-includes/post.php
504 504 $parent_data = array( 'post_parent' => $post->post_parent ); 505 505 $parent_where = array( 'post_parent' => $postid ); 506 506 507 /* 508 * if the page is defined in option page_on_front or post_for_posts, 509 * adjust the corresponding options 510 */ 511 if ('page' == $post->post_type){ 512 513 if ($postid == get_option('page_on_front')){ 514 update_option('show_on_front', 'posts'); 515 delete_option('page_on_front'); 516 } 517 if ($postid == get_option('page_for_posts')){ 518 delete_option('page_for_posts'); 519 } 520 } 521 507 522 if ( 'page' == $post->post_type ) 508 523 $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'page' ) ); 509 524
