add_option

add_option

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

do_action('add_option') is found 1 times:

  • /wp-includes/option.php line 1132
    	 *
    	 * @param string $option Name of the option to add.
    	 * @param mixed  $value  Value of the option.
    	 */
    	do_action( 'add_option', $option, $value );
    
    	$result = $wpdb->query( $wpdb->prepare( "INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, %s) ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)", $option, $serialized_value, $autoload ) );
    	if ( ! $result ) {
    		return false;
    	}
    
    

See this hook used in plugins: