delete_option_{$option}
Action HookDescription
Fires after a specific option has been deleted. The dynamic portion of the hook name, `$option`, refers to the option name.Hook Information
File Location |
wp-includes/option.php
View on GitHub
|
Hook Type | Action |
Line Number | 1265 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$option
|
Name of the deleted option. |
Usage Examples
Basic Usage
<?php
// Hook into delete_option_{$option}
add_action('delete_option_{$option}', 'my_custom_function', 10, 1);
function my_custom_function($option) {
// Your custom code here
}
Source Code Context
wp-includes/option.php:1265
- How this hook is used in WordPress core
<?php
1260 *
1261 * @since 3.0.0
1262 *
1263 * @param string $option Name of the deleted option.
1264 */
1265 do_action( "delete_option_{$option}", $option );
1266
1267 /**
1268 * Fires after an option has been deleted.
1269 *
1270 * @since 2.9.0
PHP Documentation
<?php
/**
* Fires after a specific option has been deleted.
*
* The dynamic portion of the hook name, `$option`, refers to the option name.
*
* @since 3.0.0
*
* @param string $option Name of the deleted option.
*/
Quick Info
- Hook Type: Action
- Parameters: 1
- File: wp-includes/option.php
Related Hooks
Related hooks will be displayed here in future updates.