[wp-testers] upload_url_path is always overwritten in function wp_upload_dir

Jim McQuillan jim at jimmcq.com
Mon Apr 5 20:30:27 UTC 2010


I need to have a custom upload_path and upload_url_path so that uploads are
served from a separate dedicated server. The problem is that the file URL is
always being overwritten by a URL that points to a subdirectory under my
main wordpress install.

I tracked down the problem to the following code within the wp_upload_dir
function of wp-includes/functions.php:

if ( defined('UPLOADS') && ( WP_CONTENT_DIR . '/uploads' != ABSPATH .
$upload_path ) ) {
    $dir = ABSPATH . UPLOADS;
    $url = trailingslashit( $siteurl ) . UPLOADS;

}

Because I have an $upload_path defined this conditional is always trigged
and the $url is overwitten when I want it to keep it as get_option(
'upload_url_path' ) as it was set to before this bit of code.


I filed this as a bug# 12639 http://core.trac.wordpress.org/ticket/12639


More information about the wp-testers mailing list