Closed mcfadden closed 12 years ago
Tentatively we could take in an array as one of the shortcode options:
array(
"foo" => array(
"type" => "text",
"label" => "Foo"
),
"bar" => array(
"type" => "select",
"options" => array(
"",
"Foo Bar" => "foo-bar",
"abcd"
),
"label" = "Bar")
);
Could generate output similar to:
<label for="fields_foo">Foo</label>
<input type="text" name="fields_foo" />
<label for="fields_bar">Bar</label>
<select name="fields_bar">
<option value=""></option>
<option value="foo-bar">Foo Bar</option>
<option value="abcd">abcd</option>
</select>
JSON will probably be a better choice to pass in:
{
"foo": {
"type": "text",
"label": "Foo"
},
"bar": {
"type": "select",
"options": {
"FooBar": "foo-bar",
"abcd": "abcd"
},
"blank": "true",
"label": "Bar"
}
}
The shortcode would look like:
[easyicontact custom_fields='{"foo": {"type": "text","label": "Foo"},"bar": {"type": "select","options": {"FooBar": "foo-bar","abcd": "abcd"},"blank": "true","label": "Bar"}}' ]
Need to work out the best way to support custom fields.