Action hook 'wp_delete_site'

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

View Source

wp_delete_site

Action Hook
Description
Fires once a site has been deleted from the database.

Hook Information

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

Hook Parameters

Type Name Description
WP_Site $old_site Deleted site object.

Usage Examples

Basic Usage
<?php
// Hook into wp_delete_site
add_action('wp_delete_site', 'my_custom_function', 10, 1);

function my_custom_function($old_site) {
    // Your custom code here
}

Source Code Context

wp-includes/ms-site.php:283 - How this hook is used in WordPress core
<?php
 278  	 *
 279  	 * @since 5.1.0
 280  	 *
 281  	 * @param WP_Site $old_site Deleted site object.
 282  	 */
 283  	do_action( 'wp_delete_site', $old_site );
 284  
 285  	/**
 286  	 * Fires after the site is deleted from the network.
 287  	 *
 288  	 * @since 4.8.0

PHP Documentation

<?php
/**
	 * Fires once a site has been deleted from the database.
	 *
	 * @since 5.1.0
	 *
	 * @param WP_Site $old_site Deleted site object.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/ms-site.php
Related Hooks

Related hooks will be displayed here in future updates.