WordPress.org

Make WordPress Core

Ticket #22883: 22883.diff

File 22883.diff, 428 bytes (added by dd32, 9 years ago)

Upgrade objects to WP_Post objects if passed in

  • wp-includes/post.php

     
    35813581 * @return string Page URI.
    35823582 */
    35833583function get_page_uri($page) {
    3584         if ( ! is_object($page) )
    3585                 $page = get_post( $page );
     3584        $page = get_post( $page );
     3585
    35863586        $uri = $page->post_name;
    35873587
    35883588        foreach ( $page->ancestors as $parent ) {