delete_option_<option>
Fires after a specific option has been deleted.
Description
The dynamic portion(s) of the hook name refer to the option name.
Parameters (1)
- 0. $option (string)
- Name of the deleted option.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'delete_option_{$option}', $option );
- The following example is for adding a hook callback.
- // define the delete_option_<option> callback
- function action_delete_option_option( $option ) {
- // make action magic happen here...
- };
- // add the action
- add_action( "delete_option_{$option}", 'action_delete_option_option', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( "delete_option_{$option}", 'action_delete_option_option', 10, 1 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/option.php
- do_action( "delete_option_{$option}", $option );