Changeset 53548
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php
r52422 r53548 220 220 'update_post_term_cache' => false, 221 221 'update_post_meta_cache' => false, 222 'ignore_sticky_posts' => true, // sticky posts will still appear, but they won't be moved to the front. 222 223 ), 223 224 $post_type -
trunk/tests/phpunit/tests/sitemaps/wpSitemapsPosts.php
r51492 r53548 64 64 65 65 /** 66 * Tests that sticky posts are not moved to the front of the first page of the post sitemap. 67 * 68 * @ticket 55633 69 */ 70 public function test_posts_sticky_posts() { 71 $factory = self::factory(); 72 73 // Create 4 posts, and stick the last one. 74 $post_ids = $factory->post->create_many( 4 ); 75 $last_post_id = end( $post_ids ); 76 stick_post( $last_post_id ); 77 78 $posts_provider = new WP_Sitemaps_Posts(); 79 80 $url_list = $posts_provider->get_url_list( 1, 'post' ); 81 82 $this->assertCount( count( $post_ids ), $url_list ); 83 // Check that the URL list is still in the order of the post IDs (i.e., sticky post wasn't moved to the front). 84 foreach ( $post_ids as $idx => $post_id ) { 85 $this->assertSame( array( 'loc' => home_url( "?p={$post_id}" ) ), $url_list[ $idx ] ); 86 } 87 } 88 89 /** 66 90 * Callback for 'wp_sitemaps_posts_show_on_front_entry' filter. 67 91 */
Note: See TracChangeset
for help on using the changeset viewer.