WordPress.org

Make WordPress Core

Ticket #12327: 12327.diff

File 12327.diff, 1.0 KB (added by duck_, 8 years ago)
  • wp-admin/includes/post.php

     
    10431043
    10441044        // Handle page hierarchy
    10451045        if ( $ptype->hierarchical ) {
    1046                 $uri = get_page_uri($post->ID);
     1046                $uri = get_page_uri($post);
    10471047                $uri = untrailingslashit($uri);
    10481048                $uri = strrev( stristr( strrev( $uri ), '/' ) );
    10491049                $uri = untrailingslashit($uri);
  • wp-includes/post.php

     
    29042904 *
    29052905 * @since 1.5.0
    29062906 *
    2907  * @param int $page_id Page ID.
     2907 * @param mixed $page Page object or page ID.
    29082908 * @return string Page URI.
    29092909 */
    2910 function get_page_uri($page_id) {
    2911         $page = get_page($page_id);
     2910function get_page_uri($page) {
     2911        if ( ! is_object($page) )
     2912                $page = get_page($page);
    29122913        $uri = $page->post_name;
    29132914
    29142915        // A page cannot be it's own parent.