Changeset 27692
- Timestamp:
- 03/24/2014 09:29:14 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r27635 r27692 1294 1294 'posts_per_page' => 1, 1295 1295 'post_status' => 'publish', 1296 'post_type' => 'post',1296 'post_type' => $this->current_post->post_type, 1297 1297 'orderby' => 'date', 1298 1298 'order' => 'previous' === $this->adjacent ? 'DESC' : 'ASC', -
trunk/tests/phpunit/tests/link.php
r27635 r27692 176 176 $post_one = $this->factory->post->create_and_get( array( 177 177 'post_title' => 'First', 178 'post_date' => '2012-01-01 12:00:00'178 'post_date' => '2012-01-01 12:00:00', 179 179 ) ); 180 180 181 181 $post_two = $this->factory->post->create_and_get( array( 182 182 'post_title' => 'Second', 183 'post_date' => '2012-02-01 12:00:00'183 'post_date' => '2012-02-01 12:00:00', 184 184 ) ); 185 185 186 186 $post_three = $this->factory->post->create_and_get( array( 187 187 'post_title' => 'Third', 188 'post_date' => '2012-03-01 12:00:00'188 'post_date' => '2012-03-01 12:00:00', 189 189 ) ); 190 190 191 191 $post_four = $this->factory->post->create_and_get( array( 192 192 'post_title' => 'Fourth', 193 'post_date' => '2012-04-01 12:00:00' 193 'post_date' => '2012-04-01 12:00:00', 194 ) ); 195 196 // Use pages to test post-type adjacency 197 $page_one = $this->factory->post->create_and_get( array( 198 'post_title' => 'First Page', 199 'post_date' => '2013-01-01 12:00:00', 200 'post_type' => 'page', 201 ) ); 202 203 $page_two = $this->factory->post->create_and_get( array( 204 'post_title' => 'Second Page', 205 'post_date' => '2013-02-01 12:00:00', 206 'post_type' => 'page', 194 207 ) ); 195 208 … … 234 247 $this->assertEquals( $post_three, get_adjacent_post( false, null, false ) ); 235 248 remove_filter( 'get_next_post_sort', array( $this, 'filter_next_post_sort_limit' ) ); 249 250 // Test post-type specificity 251 $this->go_to( get_permalink( $page_one ) ); 252 $this->assertEquals( $page_two, get_adjacent_post( false, null, false ) ); 253 254 $this->go_to( get_permalink( $page_two ) ); 255 $this->assertEquals( $page_one, get_adjacent_post( false, null, true ) ); 236 256 } 237 257
Note: See TracChangeset
for help on using the changeset viewer.