wp_validate_site_deletion хук-событиеWP 5.1.0

Fires before a site should be deleted from the database.

Plugins should amend the $errors object via its WP_Error::add() method. If any errors are present, the site will not be deleted.

Использование

add_action( 'wp_validate_site_deletion', 'wp_kama_validate_site_deletion_action', 10, 2 );

/**
 * Function for `wp_validate_site_deletion` action-hook.
 * 
 * @param WP_Error $errors   Error object to add validation errors to.
 * @param WP_Site  $old_site The site object to be deleted.
 *
 * @return void
 */
function wp_kama_validate_site_deletion_action( $errors, $old_site ){

	// action...
}
$errors(WP_Error)
Error object to add validation errors to.
$old_site(WP_Site)
The site object to be deleted.

Список изменений

С версии 5.1.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.