Make WordPress Core

Changeset 34001

Timestamp:
09/10/2015 04:53:52 PM (9 years ago)
Author:
wonderboymusic
Message:

In get_page_uri(), do not add parent slugs to orphaned pages.

Adds unit test.

Props filosofo, MikeHansenMe, MikeHansenMe, chriscct7.
Fixes #15963.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-functions.php

    r33954 r34001  
    41974197
    41984198    foreach ( $page->ancestors as $parent ) {
    4199         $uri = get_post( $parent )->post_name . '/' . $uri;
     4199        $parent = get_post( $parent );
     4200        if ( 'publish' === $parent->post_status ) {
     4201            $uri = $parent->post_name . '/' . $uri;
     4202        }
    42004203    }
    42014204
  • trunk/tests/phpunit/tests/post.php

    r33910 r34001  
    652652
    653653    /**
     654
     655
     656
     657
     658
     659
     660
     661
     662
     663
     664
     665
     666
     667
     668
     669
     670
     671
    654672     * @ticket 23708
    655673     */
Note: See TracChangeset for help on using the changeset viewer.