Support » Plugins » Issue with passing settings values (possibly register_settings() related?)

  • Resolved Doodlebee


    Hey all,

    I was wondering if someone could help me here. I’m trying to update my plugin, and i’ve added a settings page (nothing that the plugin has ever had before). I used Otto’ tutorial on adding a settings page, and it’s worked a treat.


    I found the need to add a new filed to my settings page, but when I added it, it will not save.

    The code is here, if you’d like to take a look.

    Now, under the bei_options_validate() function, I’ve added print_r($input) to see what’s being passed when I submit the form, and it returns Array ( [admin] => activate_plugins [public] => no [registered] => yes ) every time. It SHOULD be retuning Array ( [admin] => activate_plugins [public] => no [registered] => yes [view] => selected_value ) – which makes me think that my new field has not been registered. but it makes no sense, because (as you can see in the code) it’s there.

    And yes, I have the plugin set to add_option (so it can be registered) with all the proper keys, with default values.

    I’m thinking it’s either the fact that it’s a new settings field in an old options setting (but I’ve been completely removing the options every time I want to test – the option is gone, but upon activation, it’s put back in fresh and clean – it’s just when I save the form, it seems to remove “view” field…


    I’ve got my dropdown set to pass field incorrectly. All the other fields are radio buttons. it seems to pass an empty value every time. So it’s possible I have the dropdowns set up wrong and it’s not passing the value.

    I’m honestly hoping it’s the latter issue, because I think that’ll be easier to fix!

    Anyway, if anyone’s got an extra pair of eyes that you can run over this code and see what I’m doing wrong, I’d appreciate it.

Viewing 1 replies (of 1 total)
  • GAH! I found it.

    it was on line 87 of the code:

    echo '<p><select id="bei_view" name="name="bei_options[view]"></p>' . "\n";

    darn copy/paste. I have “name” in there twice… it should look like:

    echo '<p><select id="bei_view" name="bei_options[view]"></p>' . "\n";

    I feel smart for the day! Thanks anyway, all 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Issue with passing settings values (possibly register_settings() related?)’ is closed to new replies.