update_site_option_(option) хук-событиеWP 3.0.0

Fires after the value of a specific network option has been successfully updated.

The dynamic portion of the hook name, $option, refers to the option name.

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

add_action( 'update_site_option_(option)', 'wp_kama_update_site_option_action', 10, 4 );

/**
 * Function for `update_site_option_(option)` action-hook.
 * 
 * @param string $option     Name of the network option.
 * @param mixed  $value      Current value of the network option.
 * @param mixed  $old_value  Old value of the network option.
 * @param int    $network_id ID of the network.
 *
 * @return void
 */
function wp_kama_update_site_option_action( $option, $value, $old_value, $network_id ){

	// action...
}
$option(строка)
Name of the network option.
$value(разное)
Current value of the network option.
$old_value(разное)
Old value of the network option.
$network_id(int)
ID of the network.

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

С версии 3.0.0 Введена.
С версии 2.9.0 As "update_site_option_{$key}"
С версии 4.7.0 The $network_id parameter was added.

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

update_network_option()
update_site_option_(option)
wp-includes/option.php 1822
do_action( "update_site_option_{$option}", $option, $value, $old_value, $network_id );

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

wp-admin/includes/ms-admin-filters.php 23
add_action( 'update_site_option_admin_email', 'wp_network_admin_email_change_notification', 10, 4 );
wp-admin/includes/ms-admin-filters.php 44
add_action( 'update_site_option_new_admin_email', 'update_network_option_new_admin_email', 10, 2 );