delete_option_(option)
Fires after a specific option has been deleted.
The dynamic portion of the hook name, $option, refers to the option name.
Usage
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(string)
- Name of the deleted option.
Changelog
| Since 3.0.0 | Introduced. |
Where the hook is called
wp-includes/option.php 1262
do_action( "delete_option_{$option}", $option );
Where the hook is used in WordPress
wp-includes/blocks/site-logo.php 210
add_action( "delete_option_theme_mods_$theme", '_delete_site_logo_on_remove_theme_mods' );
wp-includes/blocks/site-logo.php 234
add_action( 'delete_option_site_logo', '_delete_custom_logo_on_remove_site_logo' );