Skip to content

Commit 7d39052

Browse files
committed
Return base dir and url from wp_upload_dir(). Props DD32. fixes WordPress#6762
git-svn-id: https://develop.svn.wordpress.org/trunk@8280 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 90961eb commit 7d39052

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

wp-includes/functions.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,10 @@ function wp_upload_dir( $time = NULL ) {
14951495
$dir = ABSPATH . UPLOADS;
14961496
$url = trailingslashit( $siteurl ) . UPLOADS;
14971497
}
1498-
1498+
1499+
$bdir = $dir;
1500+
$burl = $url;
1501+
14991502
$subdir = '';
15001503
if ( get_option( 'uploads_use_yearmonth_folders' ) ) {
15011504
// Generate the yearly and monthly dirs
@@ -1515,7 +1518,7 @@ function wp_upload_dir( $time = NULL ) {
15151518
return array( 'error' => $message );
15161519
}
15171520

1518-
$uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'error' => false );
1521+
$uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false );
15191522
return apply_filters( 'upload_dir', $uploads );
15201523
}
15211524

0 commit comments

Comments
 (0)