wp_delete_site action-hookWP 5.1.0

Fires once a site has been deleted from the database.

Usage

add_action( 'wp_delete_site', 'wp_kama_delete_site_action' );

/**
 * Function for `wp_delete_site` action-hook.
 * 
 * @param WP_Site $old_site Deleted site object.
 *
 * @return void
 */
function wp_kama_delete_site_action( $old_site ){

	// action...
}
$old_site(WP_Site)
Deleted site object.

Changelog

Since 5.1.0 Introduced.

Where the hook is called

wp_delete_site()
wp_delete_site
wp-includes/ms-site.php 283
do_action( 'wp_delete_site', $old_site );

Where the hook is used in WordPress

wp-includes/ms-default-filters.php 47
add_action( 'wp_delete_site', 'wp_maybe_update_network_site_counts_on_update', 10, 1 );