WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/23/2016 10:04:20 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Permalinks: In get_page_uri(), don't prepend a parent page slug if it's empty.

Props inderpreet99, SergeyBiryukov.
Fixes #36174.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/getPageUri.php

    r38144 r38145  
    4848
    4949    /**
     50     * @ticket 36174
     51     */
     52    function test_get_page_uri_with_a_draft_parent_with_empty_slug() {
     53        $parent_id = self::factory()->post->create( array( 'post_name' => 'parent' ) );
     54        $child_id = self::factory()->post->create( array( 'post_name' => 'child', 'post_parent' => $parent_id ) );
     55
     56        wp_update_post( array( 'ID' => $parent_id, 'post_name' => '', 'post_status' => 'draft' ) );
     57
     58        $this->assertEquals( 'child', get_page_uri( $child_id ) );
     59    }
     60
     61    /**
    5062     * @ticket 26284
    5163     */
Note: See TracChangeset for help on using the changeset viewer.