Using the “UPLOAD_DIR” filter
-
Dear all,
I am using Nextgen gallery plugin on a multisite network.
One of my custom plug-ins uses this code :
// Forcing all sub-domains to use the same uploads folder if( !function_exists( 'no_uploads_subfolders' ) ){ function no_uploads_subfolders( $dirs ) { $dirs['baseurl'] = network_site_url( '/wp-content/uploads' ); $dirs['basedir'] = ABSPATH . 'wp-content/uploads'; $dirs['path'] = $dirs['basedir'] . $dirs['subdir']; $dirs['url'] = $dirs['baseurl'] . $dirs['subdir']; return $dirs; } } add_filter( 'upload_dir', 'no_uploads_subfolders' );
However, when I upload an image in NextGen gallery, the resulting file is saved at /wp-content/uploads/site/2/nggallery instead of /wp-content/uploads/nggallery as I would like to.
Could you please help me force this plugin to use the root folder, as I share images and galleries accross multiple sites ?
Thank you very much !
By the way : I am using it on a staging website and therefore won’t have any public URL to share, sorry.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Using the “UPLOAD_DIR” filter’ is closed to new replies.