I'm using Caldera WP forms plus Users for Caldera Forms add-on to generate and render user profile data forms on the front-end. The plugins enable you to create forms in the back-end and insert them via shortcode in a page or post.

When creating dropdown fields (input[tpy=select]), pre-defined select options can be defined. However, the plugin has no native option to group such select options. As this makes a lot of sense sometime, I'm thinking of a workaround like this:

  • Use placeholders in pre-defined option value lists in the plugin backend, say --Group 1-- ... --Group n--
  • Use filter to parse the shortcode's HTML output before it's finally added to the content to
  • Replace strings <option value="">--Group x--</option> with <optgroup label="Group 1">

Does this make sense? If so, what filter to use for this approach?

  • If you have a question about the inner workings of a third party plugin/theme, you have a better chance of getting an answer at its author's forum, – cjbj Nov 25 '16 at 13:39
  • Thanks for answer, @cjbj. I'm aware of that. However, imho my question is not merely about the plugin I've mentioned, but rather of more general nature. Could be addressed to any plugin or other tool that renders form fields in the front-end via shortcode. – Bunjip Nov 25 '16 at 14:13
  • This is plugin specific, there's no filter unless the plugin implements its own. – Milo Nov 25 '16 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.