Make WordPress Core


Ignore:
Timestamp:
08/23/2012 08:01:10 PM (13 years ago)
Author:
ryan
Message:

Remove return ref from all calls to get_post()
Return WP_Post from get_default_post_to_edit()
Replace all calls to get_page() with get_post()
see #21309

File:
1 edited

Legend:

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

    r21572 r21597  
    587587 */
    588588function get_post_mime_type($ID = '') {
    589     $post = & get_post($ID);
     589    $post = get_post($ID);
    590590
    591591    if ( is_object($post) )
     
    33493349
    33503350    if ( $foundid )
    3351         return get_page( $foundid, $output );
     3351        return get_post( $foundid, $output );
    33523352
    33533353    return null;
     
    33693369    $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) );
    33703370    if ( $page )
    3371         return get_page($page, $output);
     3371        return get_post( $page, $output );
    33723372
    33733373    return null;
     
    34563456function get_page_uri($page) {
    34573457    if ( ! is_object($page) )
    3458         $page = get_page($page);
     3458        $page = get_post( $page );
    34593459    $uri = $page->post_name;
    34603460
    34613461    foreach ( $page->ancestors as $parent ) {
    3462         $uri = get_page($parent)->post_name . "/" . $uri;
     3462        $uri = get_post( $parent )->post_name . "/" . $uri;
    34633463    }
    34643464
     
    37173717        return true;
    37183718    if ( $id = url_to_postid($url) ) {
    3719         $post = & get_post($id);
     3719        $post = get_post($id);
    37203720        if ( 'attachment' == $post->post_type )
    37213721            return true;
     
    40134013function wp_get_attachment_metadata( $post_id = 0, $unfiltered = false ) {
    40144014    $post_id = (int) $post_id;
    4015     if ( !$post =& get_post( $post_id ) )
     4015    if ( !$post = get_post( $post_id ) )
    40164016        return false;
    40174017
     
    40354035function wp_update_attachment_metadata( $post_id, $data ) {
    40364036    $post_id = (int) $post_id;
    4037     if ( !$post =& get_post( $post_id ) )
     4037    if ( !$post = get_post( $post_id ) )
    40384038        return false;
    40394039
     
    40534053function wp_get_attachment_url( $post_id = 0 ) {
    40544054    $post_id = (int) $post_id;
    4055     if ( !$post =& get_post( $post_id ) )
     4055    if ( !$post = get_post( $post_id ) )
    40564056        return false;
    40574057
     
    40924092function wp_get_attachment_thumb_file( $post_id = 0 ) {
    40934093    $post_id = (int) $post_id;
    4094     if ( !$post =& get_post( $post_id ) )
     4094    if ( !$post = get_post( $post_id ) )
    40954095        return false;
    40964096    if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) )
     
    41144114function wp_get_attachment_thumb_url( $post_id = 0 ) {
    41154115    $post_id = (int) $post_id;
    4116     if ( !$post =& get_post( $post_id ) )
     4116    if ( !$post = get_post( $post_id ) )
    41174117        return false;
    41184118    if ( !$url = wp_get_attachment_url( $post->ID ) )
     
    41414141function wp_attachment_is_image( $post_id = 0 ) {
    41424142    $post_id = (int) $post_id;
    4143     if ( !$post =& get_post( $post_id ) )
     4143    if ( !$post = get_post( $post_id ) )
    41444144        return false;
    41454145
     
    41724172        if ( is_numeric($mime) ) {
    41734173            $mime = (int) $mime;
    4174             if ( $post =& get_post( $mime ) ) {
     4174            if ( $post = get_post( $mime ) ) {
    41754175                $post_id = (int) $post->ID;
    41764176                $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid);
Note: See TracChangeset for help on using the changeset viewer.