Changeset 36128
- Timestamp:
- 12/31/2015 03:00:33 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r36127 r36128 4957 4957 global $wp_query, $wp_rewrite; 4958 4958 4959 if ( get_queried_object() ) { 4960 return; 4961 } 4962 4959 4963 if ( '' !== $wp_query->query_vars['name'] ) : 4960 4964 global $wpdb; -
trunk/tests/phpunit/tests/rewrite/oldSlugRedirect.php
r35242 r36128 151 151 } 152 152 153 /** 154 * @ticket 35031 155 */ 156 public function test_old_slug_doesnt_redirect_when_reused() { 157 $old_permalink = user_trailingslashit( get_permalink( $this->post_id ) ); 158 159 wp_update_post( array( 160 'ID' => $this->post_id, 161 'post_name' => 'bar-baz', 162 ) ); 163 164 $new_post_id = self::factory()->post->create( array( 165 'post_title' => 'Foo Bar', 166 'post_name' => 'foo-bar', 167 ) ); 168 169 $permalink = user_trailingslashit( get_permalink( $new_post_id ) ); 170 171 $this->assertEquals( $old_permalink, $permalink ); 172 173 $this->go_to( $old_permalink ); 174 wp_old_slug_redirect(); 175 $this->assertNull( $this->old_slug_redirect_url ); 176 } 177 153 178 public function filter_old_slug_redirect_url( $url ) { 154 179 $this->old_slug_redirect_url = $url;
Note: See TracChangeset
for help on using the changeset viewer.