mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Image sideload and wp_upload_dir() fixes from noel. fixes #7342 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@8369 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1489,9 +1489,9 @@ function wp_upload_dir( $time = NULL ) {
|
||||
|
||||
// $dir is absolute, $path is (maybe) relative to ABSPATH
|
||||
$dir = path_join( ABSPATH, $dir );
|
||||
|
||||
|
||||
if ( !$url = get_option( 'upload_url_path' ) ) {
|
||||
if ( empty($upload_path) )
|
||||
if ( empty($upload_path) or ( $upload_path == $dir ) )
|
||||
$url = WP_CONTENT_URL . '/uploads';
|
||||
else
|
||||
$url = trailingslashit( $siteurl ) . $upload_path;
|
||||
@@ -1523,8 +1523,9 @@ function wp_upload_dir( $time = NULL ) {
|
||||
$message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $dir );
|
||||
return array( 'error' => $message );
|
||||
}
|
||||
|
||||
|
||||
$uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false );
|
||||
|
||||
return apply_filters( 'upload_dir', $uploads );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user