I’m creating a plugin that will store some simple layouts to be used in shortcodes.
The shortcode usage will be similar to [shortcode layout="name"]
With this mind I’ll need to store each layout in the array as a key/value setup
Key = layout name
Value = layout markup
I’d like to store these in settings however I’m not sure how to go about it. How can I create a settings page that allows addition and editing. Normally my settings pages use code as follows and automatically wires into the api.
<input type="text" id="company_name" name="wpv_settings[company_name]" value="<?php echo $wpv_settings['company_name']; ?>" class="regular-text" />
However, I can’t find how to go about this when the setting is an array of key/values.
Can anyone point me in the right direction of how this would be done?
Since the layout names are dynamic, perhaps it’s better to store them in a numerically indexed nested array? Something like:
…etc?