Ticket #11863: 11863.15.diff
File 11863.15.diff, 1.6 KB (added by , 9 years ago) |
---|
-
src/wp-includes/post.php
6126 6126 6127 6127 $post = get_post( $post ); 6128 6128 6129 if ( strpos( $post->post_name, '- %trashed%' ) ) {6129 if ( strpos( $post->post_name, '-_trashed' ) ) { 6130 6130 return $post->post_name; 6131 6131 } 6132 6132 add_post_meta( $post->ID, '_wp_desired_post_slug', $post->post_name ); 6133 $post_name = _truncate_post_slug( $post->post_name, 19 0 ) . '-%trashed%';6133 $post_name = _truncate_post_slug( $post->post_name, 191 ) . '-_trashed'; 6134 6134 $wpdb->update( $wpdb->posts, array( 'post_name' => $post_name ), array( 'ID' => $post->ID ) ); 6135 6135 clean_post_cache( $post->ID ); 6136 6136 return $post_name; -
tests/phpunit/tests/post/wpInsertPost.php
15 15 'post_status' => 'publish' 16 16 ) ); 17 17 wp_trash_post( $trashed_about_page_id ); 18 $this->assertEquals( 'about- %trashed%', get_post( $trashed_about_page_id )->post_name );18 $this->assertEquals( 'about-_trashed', get_post( $trashed_about_page_id )->post_name ); 19 19 } 20 20 21 21 /** … … 49 49 'post_status' => 'publish' 50 50 ) ); 51 51 52 $this->assertEquals( 'about- %trashed%', get_post( $trashed_about_page_id )->post_name );52 $this->assertEquals( 'about-_trashed', get_post( $trashed_about_page_id )->post_name ); 53 53 $this->assertEquals( 'about', get_post( $about_page_id )->post_name ); 54 54 } 55 55