Ticket #31168: 31168-a.patch
File 31168-a.patch, 1.6 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/upgrade.php
227 227 'post_type' => 'page', 228 228 'to_ping' => '', 229 229 'pinged' => '', 230 'post_content_filtered' => '' 230 'post_content_filtered' => '', 231 'comment_status' => 'closed', 231 232 )); 232 233 $wpdb->insert( $wpdb->postmeta, array( 'post_id' => 2, 'meta_key' => '_wp_page_template', 'meta_value' => 'default' ) ); 233 234 -
src/wp-includes/post.php
3258 3258 } 3259 3259 3260 3260 if ( empty( $postarr['comment_status'] ) ) { 3261 if ( $update ) {3261 if ( $update || $post_type == 'page' ) { 3262 3262 $comment_status = 'closed'; 3263 3263 } else { 3264 3264 $comment_status = get_option('default_comment_status'); -
tests/phpunit/tests/post.php
1068 1068 $this->assertEquals( $post->$field, $value ); 1069 1069 } 1070 1070 } 1071 1072 function test_wp_insert_post_page_default_comment_status() { 1073 $args = array( 1074 'post_type' => 'page', 1075 'post_title' => 'Example Page', 1076 'post_status' => 'publish', 1077 ); 1078 1079 $post_id = $this->factory->post->create( $args ); 1080 1081 $page = get_post( $post_id ); 1082 1083 $this->assertEquals( 'closed', $page->comment_status ); 1084 } 1071 1085 }