• Hi, I’m trying to make a plugin where I have one line, like a settings field that includes two form elements. So like a checkbox and a select box.

    This is what I want to achieve below:

    Discussion settings in WordPress admin

    How can I achieve this? At the moment I’m using the add_settings_field() function but it’s adding my two settings on a new line, each with a field label.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I think your only option is to not register one of the settings and handle it independently of the Settings API. Just include its HTML as part of the other setting’s output. You’ll need to validate, sanitize, and save the input yourself. There ought to be an action you can hook that fires when the settings screen is saved. Add a callback that does what’s needed since the API cannot do this for you.

Viewing 1 replies (of 1 total)
  • The topic ‘Two settings field on one line together’ is closed to new replies.