Filter hook 'wpmu_delete_blog_upload_dir'

in WP Core File wp-includes/ms-site.php at line 846

View Source

wpmu_delete_blog_upload_dir

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

Hook Information

File Location wp-includes/ms-site.php View on GitHub
Hook Type Filter
Line Number 846

Hook Parameters

Type Name Description
string $basedir Uploads path without subdirectory. See {@see wp_upload_dir()}.
int $site_id The site ID.

Usage Examples

Basic Usage
<?php
// Hook into wpmu_delete_blog_upload_dir
add_filter('wpmu_delete_blog_upload_dir', 'my_custom_filter', 10, 2);

function my_custom_filter($basedir, $site_id) {
    // Your custom filtering logic here
    return $basedir;
}

Source Code Context

wp-includes/ms-site.php:846 - How this hook is used in WordPress core
<?php
 841  	 * @since MU (3.0.0)
 842  	 *
 843  	 * @param string $basedir Uploads path without subdirectory. See {@see wp_upload_dir()}.
 844  	 * @param int    $site_id The site ID.
 845  	 */
 846  	$dir     = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $site->id );
 847  	$dir     = rtrim( $dir, DIRECTORY_SEPARATOR );
 848  	$top_dir = $dir;
 849  	$stack   = array( $dir );
 850  	$index   = 0;
 851  

PHP Documentation

<?php
/**
	 * Filters the upload base directory to delete when the site is deleted.
	 *
	 * @since MU (3.0.0)
	 *
	 * @param string $basedir Uploads path without subdirectory. See {@see wp_upload_dir()}.
	 * @param int    $site_id The site ID.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/ms-site.php
Related Hooks

Related hooks will be displayed here in future updates.