Changeset 54464
- Timestamp:
- 10/10/2022 11:01:08 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r54410 r54464 3936 3936 $post_type_object = get_post_type_object( $post_type ); 3937 3937 3938 if ( ! $post_type_object ) { 3939 return false; 3940 } 3941 3938 3942 return in_array( $post_type_object->name, (array) $post_types, true ); 3939 3943 } -
trunk/tests/phpunit/tests/query.php
r54090 r54464 770 770 $this->assertSame( '/* posts_join_request */', $posts_clauses_request['join'] ); 771 771 } 772 773 /** 774 * Tests that is_post_type_archive() returns false for an undefined post type. 775 * 776 * @ticket 56287 777 * 778 * @covers ::is_post_type_archive 779 */ 780 public function test_is_post_type_archive_should_return_false_for_an_undefined_post_type() { 781 global $wp_query; 782 783 $post_type = '56287-post-type'; 784 785 // Force the request to be a post type archive. 786 $wp_query->is_post_type_archive = true; 787 $wp_query->set( 'post_type', $post_type ); 788 789 $this->assertFalse( is_post_type_archive( $post_type ) ); 790 } 772 791 }
Note: See TracChangeset
for help on using the changeset viewer.