Action hook 'update_blog_public'

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

View Source

update_blog_public

Action Hook
Description
Fires after the current blog's 'public' setting is updated.

Hook Information

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

Hook Parameters

Type Name Description
int $site_id Site ID.
string $is_public Whether the site is public. A numeric string, for compatibility reasons. Accepts '1' or '0'.

Usage Examples

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

function my_custom_function($site_id, $is_public) {
    // Your custom code here
}

Source Code Context

wp-includes/ms-site.php:1271 - How this hook is used in WordPress core
<?php
1266  		 *
1267  		 * @param int    $site_id   Site ID.
1268  		 * @param string $is_public Whether the site is public. A numeric string,
1269  		 *                          for compatibility reasons. Accepts '1' or '0'.
1270  		 */
1271  		do_action( 'update_blog_public', $site_id, $new_site->public );
1272  	}
1273  }
1274  
1275  /**
1276   * Cleans the necessary caches after specific site data has been updated.

PHP Documentation

<?php
/**
		 * Fires after the current blog's 'public' setting is updated.
		 *
		 * @since MU (3.0.0)
		 *
		 * @param int    $site_id   Site ID.
		 * @param string $is_public Whether the site is public. A numeric string,
		 *                          for compatibility reasons. Accepts '1' or '0'.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/ms-site.php
Related Hooks

Related hooks will be displayed here in future updates.