Make WordPress Core


Ignore:
Timestamp:
02/18/2016 12:23:04 AM (8 years ago)
Author:
azaozz
Message:

Replace wp_upload_dir() with the new wp_get_upload_dir() in all cases where a file is not being uploaded. Deprecate _wp_upload_dir_baseurl(), and replace it with wp_get_upload_dir().

See #34359.

File:
1 edited

Legend:

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

    r36517 r36569  
    904904
    905905/**
    906  * Caches and returns the base URL of the uploads directory.
    907  *
    908  * @since 4.4.0
    909  * @access private
    910  *
    911  * @return string The base URL, cached.
    912  */
    913 function _wp_upload_dir_baseurl() {
    914     static $baseurl = array();
    915 
    916     $blog_id = get_current_blog_id();
    917 
    918     if ( empty( $baseurl[$blog_id] ) ) {
    919         $uploads_dir = wp_upload_dir();
    920         $baseurl[$blog_id] = $uploads_dir['baseurl'];
    921     }
    922 
    923     return $baseurl[$blog_id];
    924 }
    925 
    926 /**
    927906 * Get the image size as array from its meta data.
    928907 *
     
    10461025    }
    10471026
    1048     $image_baseurl = _wp_upload_dir_baseurl();
    1049     $image_baseurl = trailingslashit( $image_baseurl ) . $dirname;
     1027    $upload_dir = wp_get_upload_dir();
     1028    $image_baseurl = trailingslashit( $upload_dir['baseurl'] ) . $dirname;
    10501029
    10511030    /*
     
    37403719    global $wpdb;
    37413720
    3742     $dir = wp_upload_dir();
     3721    $dir = wp_get_upload_dir();
    37433722    $path = $url;
    37443723
Note: See TracChangeset for help on using the changeset viewer.