• Hello all

    I’m developing a plugin for creating form components via shortcode. Creating option sets, listboxes and collections of radioboxes for example, I’d like to have a single parent shortcode defining the grouping and list type for the subsequent options, a la:

    [form_item id="groupname" type="radio"]
      [form_item_option value="item1"]Item Label 1[/form item]
      [form_item_option value="item2"]Item Label 2[/form item]
      [form_item_option value="item3"]Item Label 3[/form item]
    [/form]

    Now, in translating this to markup, I’d like this to appear as follows:

    <input type="radio" name="groupname" id="item1" />
    <label for="item1">Item Label 1</label>
    
    <input type="radio" name="groupname" id="item2" />
    <label for="item2">Item Label 2</label>
    
    <input type="radio" name="groupname" id="item3" />
    <label for="item3">Item Label 3</label>

    Of course, in order for this to work, I need to be able to pull the the parent form_item node’s attributes from the .do_shortcode for each child element (form_item_option).

    And herein I am stumped. Can someone show me the light?

    Thanks in advance!

    Stacey

  • The topic ‘Getting Attributes from Shortcode’ is closed to new replies.