Codex tools: Log in / create account
Contents |
A safe way of adding a named option/value pair to the options database table. It does nothing if the option already exists. 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'); ?>
This article is marked as in need of editing. You can help Codex by editing it.