add_option

Description

A safe way of adding meta_key/meta_value pairs to the options_meta database table. The option does nothing if  the key already exists.

Usage

<?php add_option($name, $value = ''); ?>

Parameters

$name (string) (required) Name of the meta key to be added.

$value (mixed) (optional) Value of the meta_key name.

Return Values

(boolean)  True if added successfully and false otherwise.

Example

add_option('calendar_start_day','Sunday');

Change Log

Since 6.0.03

Source File

add_option() is located in app/functions/hook-function.php.