I have made a wordpress plugin that can fetch an unknown number of Google calendar feeds and show the next event for every calendar in a widget. It works, but right now I have hardcoded the feeds into the code. It does’nt seems like very good practise so I am planning for an admin interface. For every feed I add there is three pieces of information that are stored with them in an array: a) the feed url. b) A nickname for the feed. c) If the nickname should be shown.
Here is some ugly mockup of the admin interface I did just to show the idea:

My problems with this:
-
I know by all tutorials how to store one piece of information in one variable. But how do I store an unknown number of them? Could I use an array with the $instance variable? I have really no clue from the code samples I’ve seen of how to do that.
-
How do I make this dynamic, so for every feed I add it instantly shows up in the interface? There would be great to be able to change the order of them also.
I want to learn and regarding question number two I think I could come upp with something in javascript when I’m there. But for question number one I have no idea where to start looking. So if someone could give some hints and a push in the right direction I would be very thankful.
Update
Thanks for the input. I really need to free some time to try to implement this, but i may take a few days more. The answer that was the most helpfull to me get the bounty…
You can save array’s with add_option(), update_option() And read get_option()
I would recommend against this if you plan to store more then ~20.
As suggested for the dynamic adding of multiple field I suggest jQuery.