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

Fires after a specific option has been deleted.

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

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

add_action( 'delete_option_(option)', 'wp_kama_delete_option_action' );

/**
 * Function for `delete_option_(option)` action-hook.
 * 
 * @param string $option Name of the deleted option.
 *
 * @return void
 */
function wp_kama_delete_option_action( $option ){

	// action...
}
$option(строка)
Name of the deleted option.

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

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

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

delete_option()
delete_option_(option)
wp-includes/option.php 752
do_action( "delete_option_{$option}", $option );

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

wp-includes/blocks/site-logo.php 181
add_action( "delete_option_theme_mods_$theme", '_delete_site_logo_on_remove_theme_mods' );
wp-includes/blocks/site-logo.php 201
add_action( 'delete_option_site_logo', '_delete_custom_logo_on_remove_site_logo' );