Ticket #31711: 31711.patch
File 31711.patch, 1.6 KB (added by , 9 years ago) |
---|
-
src/wp-includes/query.php
4308 4308 // most likely case 4309 4309 if ( 'posts' == get_option( 'show_on_front') && $this->is_home() ) 4310 4310 return true; 4311 elseif ( 'page' == get_option( 'show_on_front') && get_option( 'page_on_front' ) && $this->is_page( get_option( 'page_on_front' )) )4311 elseif ( 'page' == get_option( 'show_on_front') && get_option( 'page_on_front' ) && $this->is_page() && $this->get_queried_object_id() == get_option( 'page_on_front' ) ) 4312 4312 return true; 4313 4313 else 4314 4314 return false; -
tests/phpunit/tests/query/conditionals.php
988 988 $this->assertFalse( is_page_template( array( 'test.php' ) ) ); 989 989 $this->assertTrue( is_page_template( array('test.php', 'example.php') ) ); 990 990 } 991 992 /** 993 * @ticket 31711 994 */ 995 function test_is_front_page_id_equals_the_title_of_other_page() { 996 $post_1 = $this->factory->post->create( array( 'post_type' => 'page' ) ); 997 $post_2 = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => $post_1 ) ); 998 999 update_option('show_on_front', 'page'); 1000 update_option('page_on_front', $post_1); 1001 1002 $this->go_to( "/?page_id=$post_1" ); 1003 $this->assertTrue( is_front_page() ); 1004 1005 $this->go_to( "/?page_id=$post_2" ); 1006 $this->assertFalse( is_front_page() ); 1007 } 991 1008 }