Make WordPress Core

Ticket #11863: 11863.15.diff

File 11863.15.diff, 1.6 KB (added by ericlewis, 9 years ago)
  • src/wp-includes/post.php

     
    61266126
    61276127        $post = get_post( $post );
    61286128
    6129         if ( strpos( $post->post_name, '-%trashed%' ) ) {
     6129        if ( strpos( $post->post_name, '-_trashed' ) ) {
    61306130                return $post->post_name;
    61316131        }
    61326132        add_post_meta( $post->ID, '_wp_desired_post_slug', $post->post_name );
    6133         $post_name = _truncate_post_slug( $post->post_name, 190 ) . '-%trashed%';
     6133        $post_name = _truncate_post_slug( $post->post_name, 191 ) . '-_trashed';
    61346134        $wpdb->update( $wpdb->posts, array( 'post_name' => $post_name ), array( 'ID' => $post->ID ) );
    61356135        clean_post_cache( $post->ID );
    61366136        return $post_name;
  • tests/phpunit/tests/post/wpInsertPost.php

     
    1515                        'post_status' => 'publish'
    1616                ) );
    1717                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 );
    1919        }
    2020
    2121        /**
     
    4949                        'post_status' => 'publish'
    5050                ) );
    5151
    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 );
    5353                $this->assertEquals( 'about', get_post( $about_page_id )->post_name );
    5454        }
    5555