Cancal my last message, Mr Thicko here.
Plugin Options page loads and I can edit but when I save the settings the default s return.
Obviously something wonky.
This is how I set up the defaults:
function cbf_add_defaults() {
$tmp = get_option('cbf_options');
$arr = array("txt_1" => "Your Name");
add_option('cbf_options', $arr);
}
This is how I register the options:
function cbf_init(){
register_setting( 'cbf_plugin_options', 'cbf_options[txt_1]', 'cbf_validate_options' );
}
This is the options form:
<form method="post" action="options.php">
<?php settings_fields('cbf_plugin_options'); ?>
<?php $options = get_option('cbf_options'); ?>
<p>Enter the label: <input type="text" size="60" name="cbf_options[txt_1]" value="<?php echo $options['txt_1']; ?>" /></p>
<p class="submit"><input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /></p>
</form>
All seems to be in place according to the codex and umpteen tutorials and articles. It's just not saving. I edit the label, hit submit and the default returns. When I actually use the plugin the lable doesn't show.
<?php echo get_option('cbf_options(txt_1)'); ?>
Is empty no matter how I format the get_options
Help?