diff --git src/wp-includes/query.php src/wp-includes/query.php
index 053f4e9..8ab5f32 100644
|
|
class WP_Query { |
4502 | 4502 | |
4503 | 4503 | $page_obj = $this->get_queried_object(); |
4504 | 4504 | |
4505 | | $page = (array) $page; |
| 4505 | $page = array_map( 'strval', (array) $page ); |
4506 | 4506 | |
4507 | 4507 | if ( in_array( (string) $page_obj->ID, $page ) ) { |
4508 | 4508 | return true; |
diff --git tests/phpunit/tests/query/conditionals.php tests/phpunit/tests/query/conditionals.php
index a1f3665..3e1c036 100644
|
|
class Tests_Query_Conditionals extends WP_UnitTestCase { |
1017 | 1017 | $this->assertFalse( is_page_template( array( 'test.php' ) ) ); |
1018 | 1018 | $this->assertTrue( is_page_template( array('test.php', 'example.php') ) ); |
1019 | 1019 | } |
| 1020 | |
| 1021 | /** |
| 1022 | * @ticket 35902 |
| 1023 | */ |
| 1024 | function test_page_should_cast_argument_to_string() { |
| 1025 | $page_1 = self::factory()->post->create( array( 'post_type' => 'page', 'post_title' => 'About' ) ); |
| 1026 | $page_2 = self::factory()->post->create( array( 'post_type' => 'page', 'post_title' => "$page_1/7 About" ) ); |
| 1027 | $this->go_to( get_permalink( $page_2 ) ); |
| 1028 | $this->assertQueryTrue( 'is_page', 'is_singular' ); |
| 1029 | $this->assertTrue( is_page( $page_2 ) ); |
| 1030 | $this->assertFalse( is_page( $page_1 ) ); |
| 1031 | } |
1020 | 1032 | } |