title: Saving multiple key/value pairs in WordPress
body: <p>While working on a WordPress plugin for fetching a certain number of RSS feeds, I have ran into a bit of a design problem. </p>
  
  <p>The URLs for the feeds should be able to be configured by the user, which is working perfectly fine for a fixed number of feeds. The user can enter the URLs for these feeds on the appropiate Settings page, which obviously uses WordPress' Settings API.</p>
  
  <p>My goal, however, is to give the user the ability to enter an unknown number of feeds, along with labels and IDs to display and identify them. The problem lies in the way to represent this data. My desired result is to have a function that returns (something like) this:</p>
  
  <pre class="lang-php prettyprint-override"><code>$feed_categories = array(
      array(
          'id' =&gt; 'tools',
          'label' =&gt; 'Tools',
      'url' 'example.org/toolsfeed/feed.xml',
  ),
  array(
      'id' =&gt; 'questions',
          'label' =&gt; 'Questions',
          'url' =&gt; 'www.example.com/feeds/questions.xml',
  ),
      // Etc
  );
  </code></pre>
  
  <p>Now, I know I can store this kind of array using the WordPress Settings API I'm currently using, but I'm unsure...</p>
  
  <ol>
  <li>if that's not what the Settings API was meant for, and</li>
  <li>how I would make an option page that permits "unlimited" adding of section of three key-value pairs, and how to parse that</li>
  </ol>
  
  <p><strong>Edit</strong>: the main reason I started questioning my current approach, is that the Settings (or Options) API has a simple way to generate forms for a fixed number of items, but not more. Secondly, and more importantly, I have not yet discovered a way to create a custom <code>options.php</code> page, which would be needed in order to access the incoming POST request, after which I need to proceed to validate, format, and save the sent configuration data. So basically, the practical aspect of creating a form and handling the input seems quite limited to me when I'm using the Settings API. A capability to extend the <code>options.php</code>'s functionality would be great. (Maybe I'm overlooking a hook that does what I want?)</p>
  
  <p>I have looked at the validate callback for Settings, but that would involve registering a setting which you don't really want to save, just to access the corresponding <code>$_POST</code> key.</p>
  
  <p>The other option is this scenario is just making a table to store this information. However, since this probably is something most users will set and forget for a long time, I'm worried it could be overkill.</p>
  
  <p>Do any of you know a good way to implement this in the Settings API without too much hacking, or does this really just call for a custom table?</p>
  
  <p>I'd love to hear what you think about this, and why you think so.</p>