Return base dir and url from wp_upload_dir(). Props DD32. fixes #6762
git-svn-id: https://develop.svn.wordpress.org/trunk@8280 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
90961ebf15
commit
7d39052d9e
@ -1496,6 +1496,9 @@ function wp_upload_dir( $time = NULL ) {
|
|||||||
$url = trailingslashit( $siteurl ) . UPLOADS;
|
$url = trailingslashit( $siteurl ) . UPLOADS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$bdir = $dir;
|
||||||
|
$burl = $url;
|
||||||
|
|
||||||
$subdir = '';
|
$subdir = '';
|
||||||
if ( get_option( 'uploads_use_yearmonth_folders' ) ) {
|
if ( get_option( 'uploads_use_yearmonth_folders' ) ) {
|
||||||
// Generate the yearly and monthly dirs
|
// Generate the yearly and monthly dirs
|
||||||
@ -1515,7 +1518,7 @@ function wp_upload_dir( $time = NULL ) {
|
|||||||
return array( 'error' => $message );
|
return array( 'error' => $message );
|
||||||
}
|
}
|
||||||
|
|
||||||
$uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'error' => false );
|
$uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false );
|
||||||
return apply_filters( 'upload_dir', $uploads );
|
return apply_filters( 'upload_dir', $uploads );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user