• So, I’m developing a plugin. I have an options page with tabs, and so far so good. The text and text area settings are working OK, but the drop down options aren’t saving. For reasons I don’t know. Here’s the code:

    https://codeshare.io/9OZMmB

    The HTML renders as follows:

    <select name='dropdown_settings[select_field_0]'>
        <option value='1' <?php selected( $options['select_field_0'], 1 ); ?>>INFO</option>
        <option value='2' <?php selected( $options['select_field_0'], 2 ); ?>>SDAMZUMBE</option>
        <option value='3' <?php selected( $options['select_field_0'], 3 ); ?>>CHANGARAWE</option>
    </select>

    What could I be doing wrong. (The options appear as desired, but when I click the “Submit” button it renders the first element by default).

    • This topic was modified 2 years, 8 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
  • Wrong: register_setting( 'setting-group-1', 'select_field_0' );

    Correct: register_setting( 'beem_settings-1', 'dropdown_settings' );

Viewing 1 replies (of 1 total)
  • The topic ‘Drop Down options aren’t saving in my wordpress plugin options page’ is closed to new replies.