Integrate fix_upload_details() into wp_upload_dir(). see #11644
git-svn-id: http://svn.automattic.com/wordpress/trunk@12851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
40570257b1
commit
e6b0d64b4e
|
@ -2062,8 +2062,11 @@ function wp_upload_dir( $time = null ) {
|
||||||
$url = trailingslashit( $siteurl ) . UPLOADS;
|
$url = trailingslashit( $siteurl ) . UPLOADS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_multisite() && defined( 'BLOGUPLOADDIR' ) )
|
if ( is_multisite() ) {
|
||||||
$dir = untrailingslashit(BLOGUPLOADDIR);
|
if ( defined( 'BLOGUPLOADDIR' ) )
|
||||||
|
$dir = untrailingslashit(BLOGUPLOADDIR);
|
||||||
|
$url = str_replace( UPLOADS, 'files', $url );
|
||||||
|
}
|
||||||
|
|
||||||
$bdir = $dir;
|
$bdir = $dir;
|
||||||
$burl = $url;
|
$burl = $url;
|
||||||
|
|
|
@ -36,7 +36,6 @@ add_action ( 'publish_post', 'wpmu_update_blogs_date' );
|
||||||
add_filter ( 'wp_upload_bits', 'upload_is_file_too_big' );
|
add_filter ( 'wp_upload_bits', 'upload_is_file_too_big' );
|
||||||
add_filter ( 'import_upload_size_limit', 'fix_import_form_size' );
|
add_filter ( 'import_upload_size_limit', 'fix_import_form_size' );
|
||||||
add_filter ( 'upload_mimes', 'check_upload_mimes' );
|
add_filter ( 'upload_mimes', 'check_upload_mimes' );
|
||||||
add_filter ( 'upload_dir', 'fix_upload_details' );
|
|
||||||
|
|
||||||
// Mail
|
// Mail
|
||||||
add_filter ( 'wp_mail_from', 'wordpressmu_wp_mail_from' );
|
add_filter ( 'wp_mail_from', 'wordpressmu_wp_mail_from' );
|
||||||
|
|
|
@ -1626,12 +1626,6 @@ function get_most_recent_post_of_user( $user_id ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Misc functions */
|
/* Misc functions */
|
||||||
function fix_upload_details( $uploads ) {
|
|
||||||
$uploads['url'] = str_replace( UPLOADS, "files", $uploads['url'] );
|
|
||||||
$uploads['baseurl'] = str_replace( UPLOADS, "files", $uploads['baseurl'] );
|
|
||||||
return $uploads;
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_dirsize( $directory ) {
|
function get_dirsize( $directory ) {
|
||||||
$dirsize = get_transient( 'dirsize_cache' );
|
$dirsize = get_transient( 'dirsize_cache' );
|
||||||
if ( is_array( $dirsize ) && isset( $dirsize[ $directory ][ 'size' ] ) )
|
if ( is_array( $dirsize ) && isset( $dirsize[ $directory ][ 'size' ] ) )
|
||||||
|
|
Loading…
Reference in New Issue