WordPress.org

Ready to get started?Download WordPress

Forums

BLOGUPLOADDIR problem and possible fix (1 post)

  1. frankindelicato
    Member
    Posted 3 years ago #

    I am writing my first plugin and started testing it with 3.0. After creating the blogs.dir directory under wp-content I started testing the new MultiSite capabilities. I expected thewp_upload_dir function to return the directory /wp-content/blogs.dir/1/files/2010/07 but instead it kept returning /wp-content/uploads/2010/07. Since this is such basic functionality for the MultiSite I am not sure if my fix is proper. Am I missing something basic? The block of code in wp_upload_dir that I modified to get the expected results WAS: ` if ( is_multisite() && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
    if ( defined( 'BLOGUPLOADDIR' ) )
    $dir = untrailingslashit(BLOGUPLOADDIR);
    $url = str_replace( UPLOADS, 'files', $url );
    }
    `
    By taking out the NOT symbol in the !$main_override test in the above code everything seems to work. I prefer to NOT modify WordPress code so I need to know if this is a bug or did I miss something?

Topic Closed

This topic has been closed to new replies.

About this Topic