Changeset 36129
- Timestamp:
- 12/31/2015 03:08:28 AM (9 years ago)
- Location:
- branches/4.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4/src/wp-includes/query.php
r35690 r36129 4987 4987 global $wp_query, $wp_rewrite; 4988 4988 4989 if ( get_queried_object() ) { 4990 return; 4991 } 4992 4989 4993 if ( '' !== $wp_query->query_vars['name'] ) : 4990 4994 global $wpdb; -
branches/4.4/tests/phpunit/tests/rewrite/oldSlugRedirect.php
r35242 r36129 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.