| 1832 | * @ticket 36208 |
| 1833 | */ |
| 1834 | public function test_post_type_any_ignores_inactive_post_types() { |
| 1835 | register_post_type( 'post-type-1', array( 'exclude_from_search' => false ) ); |
| 1836 | register_post_type( 'post-type-2', array( 'exclude_from_search' => false ) ); |
| 1837 | |
| 1838 | $p1 = self::factory()->post->create( array( 'post_type' => 'post-type-1' ) ); |
| 1839 | $p2 = self::factory()->post->create( array( 'post_type' => 'post-type-2' ) ); |
| 1840 | |
| 1841 | $c1 = self::factory()->comment->create_post_comments( $p1, 1 ); |
| 1842 | self::factory()->comment->create_post_comments( $p2, 1 ); |
| 1843 | |
| 1844 | _unregister_post_type( 'post-type-1' ); |
| 1845 | $q = new WP_Comment_Query(); |
| 1846 | $found = $q->query( array( |
| 1847 | 'fields' => 'ids', |
| 1848 | 'post_type' => 'any', |
| 1849 | ) ); |
| 1850 | |
| 1851 | $this->assertEqualSets( array_merge( $c1 ), $found ); |
| 1852 | } |
| 1853 | |
| 1854 | /** |