| 136 | |
| 137 | /** |
| 138 | * @ticket 25143 |
| 139 | */ |
| 140 | public function test_custom_query_var_on_home() { |
| 141 | |
| 142 | $page_id = $this->factory->post->create( array( 'post_type' => 'page' ) ); |
| 143 | |
| 144 | update_option( 'show_on_front', 'page' ); |
| 145 | update_option( 'page_on_front', $page_id ); |
| 146 | |
| 147 | add_filter( 'query_vars', array( $this, '_register_query_var' ) ); |
| 148 | |
| 149 | $this->go_to( add_query_arg( 'foo', '1', home_url() ) ); |
| 150 | |
| 151 | $this->assertQueryTrue( 'is_front_page', 'is_page', 'is_singular' ); |
| 152 | $this->assertFalse( is_home() ); |
| 153 | $this->assertNotEmpty( get_query_var( 'foo' ) ); |
| 154 | |
| 155 | remove_filter( 'query_vars', array( $this, '_register_query_var' ) ); |
| 156 | |
| 157 | } |
| 158 | |
| 159 | public function _register_query_var( $vars ) { |
| 160 | $vars[] = 'foo'; |
| 161 | return $vars; |
| 162 | } |
| 163 | |