[Resolved] Issue with passing settings values (possibly register_settings() related?)
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.
- The topic ‘[Resolved] Issue with passing settings values (possibly register_settings() related?)’ is closed to new replies.