wpmu_delete_blog_upload_dir

Filters the upload base directory to delete when the site is deleted.

Description

apply_filters( 'wpmu_delete_blog_upload_dir', (string) $uploads_basedir, (int) $blog_id ); 

Parameters (2)

0. $uploads_basedir (string)
Uploads path without subdirectory. @see wp_upload_dir()
1. $blog_id (int)
The blog id.

Usage

To run the hook, copy the example below.
  1. $uploads_basedir = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads_basedir, $blog_id ); 
  2.  
  3. if ( !empty( $uploads_basedir ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wpmu_delete_blog_upload_dir callback 
  2. function filter_wpmu_delete_blog_upload_dir( $uploads_basedir, $blog_id ) { 
  3. // make filter magic happen here... 
  4. return $uploads_basedir
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wpmu_delete_blog_upload_dir', 'filter_wpmu_delete_blog_upload_dir', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wpmu_delete_blog_upload_dir', 'filter_wpmu_delete_blog_upload_dir', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/ms.php  
  1. $dir = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $blog_id );