title: Wordpress: specify an upload folder for a custom plugin
body: <p>I use the <a href="http://wordpress.org/plugins/simple-local-avatars/" rel="nofollow">Simple Local Avatars plugins</a> to allow users to add a forum picture on my Wordpress website.</p>
  
  <p>The default upload path is www.site.com/wp-content/uploads. Yet as I will have 100-1000 users and as this plugins creates 5 files for each avatar, it will completely mess the upload folder.</p>
  
  <p>I would like that the pictures to be uploaded in www.site.com/wp-content/uploads/avatars/ instead.</p>
  
  <p>This plugin seems to get path trough:</p>
  
  <pre><code>$upload_path = wp_upload_dir();
  </code></pre>
  
  <p>I tried several hacks such as:</p>
  
  <pre><code> $upload_path = wp_upload_dir();
   $upload_path['baseurl'] .= '/avatars';
   $upload_path['basedir'] .= '/avatars';
  </code></pre>
  
  <p>Which rises major bug as it (i don't why) include the picture binary values in the path ...</p>
  
  <p>Or this <a href="http://yoast.com/smarter-upload-handling-wp-plugins/" rel="nofollow">solution</a>:</p>
  
  <pre><code>add_filter('upload_dir', 'my_upload_dir');
  $upload = wp_upload_dir();
  remove_filter('upload_dir', 'my_upload_dir');
  
  funcion my_upload_dir($upload) {
      $upload['subdir']   = '/sub-dir-to-use' . $upload['subdir'];
      $upload['path']     = $upload['basedir'] . $upload['subdir'];
      $upload['url']      = $upload['baseurl'] . $upload['subdir'];
      return $upload;
  }
  </code></pre>
  
  <p>Which does not affect the actual upload folder.</p>
  
  <p>Also the plugin author does not seem to want to add this feature see <a href="http://wordpress.org/support/topic/change-directory-to-store-avatars" rel="nofollow">this support topic</a>.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks</p>