Codex tools: Log in
Contents |
A safe way of adding a named option/value pair to the options database table. It does nothing if the option already exists. After the option is saved, it can be accessed with get_option(), changed with update_option(), and deleted with delete_option().
The data is escaped with
$wpdb->escape
before the INSERT statement.
In the lasts versions of WordPress (2.3.X) the parameter $description is deprecated and remove the values from the wp_options table. The usage is the same but the second parameter its unused.
See below for older version of this reference
<?php add_option($name, $value = '', $deprecated = '', $autoload = 'yes'); ?>
<?php add_option("myhack_extraction_length", '255', '', 'yes'); ?>
In the last versions of wordpress (2.3.X) the parameter $description is deprecated and remove the values from the wp_options table. The usage its the same but the seccond parameter its unused. WP 2.3.X or newer <?php add_option($name, $value = '', $deprecated = '', $autoload = 'yes'); ?> <?php add_option($name, $value = '', $description = '', $autoload = 'yes'); ?>
<?php add_option("myhack_extraction_length", '255',
'Max length of extracted text in characters.', 'yes'); ?>