Action hook 'wp_update_site'

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

View Source

wp_update_site

Action Hook
Description
Fires once a site has been updated in the database.

Hook Information

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

Hook Parameters

Type Name Description
WP_Site $new_site New site object.
WP_Site $old_site Old site object.

Usage Examples

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

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

Source Code Context

wp-includes/ms-site.php:197 - How this hook is used in WordPress core
<?php
 192  	 * @since 5.1.0
 193  	 *
 194  	 * @param WP_Site $new_site New site object.
 195  	 * @param WP_Site $old_site Old site object.
 196  	 */
 197  	do_action( 'wp_update_site', $new_site, $old_site );
 198  
 199  	return (int) $new_site->id;
 200  }
 201  
 202  /**

PHP Documentation

<?php
/**
	 * Fires once a site has been updated in the database.
	 *
	 * @since 5.1.0
	 *
	 * @param WP_Site $new_site New site object.
	 * @param WP_Site $old_site Old site object.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/ms-site.php
Related Hooks

Related hooks will be displayed here in future updates.