add_option_(option)
Fires after a specific option has been added.
The dynamic portion of the hook name, $option, refers to the option name.
Usage
add_action( 'add_option_(option)', 'wp_kama_add_option_action', 10, 2 );
/**
* Function for `add_option_(option)` action-hook.
*
* @param string $option Name of the option to add.
* @param mixed $value Value of the option.
*
* @return void
*/
function wp_kama_add_option_action( $option, $value ){
// action...
}
- $option(string)
- Name of the option to add.
- $value(mixed)
- Value of the option.
Changelog
| Since 3.0.0 | Introduced. |
| Since 2.5.0 | As add_option_{$name} |
Where the hook is called
wp-includes/option.php 1174
do_action( "add_option_{$option}", $option, $value );
Where the hook is used in WordPress
wp-admin/includes/admin-filters.php 75
add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );