title: custom function for wp_list_categories to list terms as checkboxes
body: <p>I need to write a custom function for wp_list_categories so instead of displaying a hierarchical list of links they are instead a list of checkboxes with the parent terms being displayed as h3 tags.</p>
  
  <p>The final output will look like <a href="http://jsfiddle.net/amesy/kwqpf5fv/6/" rel="nofollow">http://jsfiddle.net/amesy/kwqpf5fv/6/</a></p>
  
  <p>Here is the PHP code in my WordPress template file...</p>
  
  <pre><code>&lt;?php 
  //list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin)
  
  $taxonomy     = 'tags';
  $orderby      = 'name'; 
  $show_count   = 1;      // 1 for yes, 0 for no
  $pad_counts   = 0;      // 1 for yes, 0 for no
  $hierarchical = 1;      // 1 for yes, 0 for no
  $title        = '';
  
  $args = array(
    'taxonomy'     =&gt; $taxonomy,
    'orderby'      =&gt; $orderby,
    'show_count'   =&gt; $show_count,
    'pad_counts'   =&gt; $pad_counts,
    'hierarchical' =&gt; $hierarchical,
    'title_li'     =&gt; $title
  );
  
  ?&gt;
  
  &lt;ul class="categories"&gt;
      &lt;?php wp_list_categories( $args ); ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Here is the HTML that <code>&lt;?php wp_list_categories( $args ); ?&gt;</code> outputs...</p>
  
  <pre><code>&lt;ul class="categories"&gt;
  &lt;li class="cat-item cat-item-21"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/client/" &gt;Client&lt;/a&gt;      (0)
  &lt;ul class='children'&gt;
  &lt;li class="cat-item cat-item-22"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/bmw/" &gt;BMW&lt;/a&gt; (3)
  &lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li class="cat-item cat-item-25"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/section/" &gt;Section&lt;/a&gt;    (0)
  &lt;ul class='children'&gt;
  &lt;li class="cat-item cat-item-27"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/automotive/" &gt;Automotive&lt;/a&gt; (3)
  &lt;/li&gt;
  &lt;li class="cat-item cat-item-28"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/property/" &gt;Property&lt;/a&gt; (2)
  &lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li class="cat-item cat-item-26"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/service/" &gt;Service&lt;/a&gt; (0)
  &lt;ul class='children'&gt;
  &lt;li class="cat-item cat-item-29"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/branding/" &gt;Branding&lt;/a&gt; (3)
  &lt;/li&gt;
  &lt;li class="cat-item cat-item-30"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/email/" &gt;Email&lt;/a&gt; (3)
  &lt;/li&gt;
  &lt;li class="cat-item cat-item-31"&gt;&lt;a href="http://tandsdev.co.uk/portfoliotags/website/" &gt;Website&lt;/a&gt; (2)
  &lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>The checkbox code I would like each term to be displayed as will form a filtering system which can be seen here <a href="http://jsfiddle.net/amesy/kwqpf5fv/6/" rel="nofollow">http://jsfiddle.net/amesy/kwqpf5fv/6/</a></p>
  
  <pre><code>&lt;div class="tags"&gt;
      &lt;h3&gt;service&lt;/h3&gt;
          &lt;label&gt;&lt;input type="checkbox" id="type-Website" rel="Website"&gt;Website&lt;/label&gt;
          &lt;label&gt;&lt;input type="checkbox" id="type-Email" rel="Email"&gt;Email&lt;/label&gt;
          &lt;label&gt;&lt;input type="checkbox" id="type-Branding" rel="Branding"&gt;Branding&lt;/label&gt;
      &lt;h3&gt;sector&lt;/h3&gt;
          &lt;label&gt;&lt;input type="checkbox" id="type-Automotive" rel="Automotive"&gt;Automotive&lt;/label&gt;
          &lt;label&gt;&lt;input type="checkbox" id="type-Property" rel="Property"&gt;Property&lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would still like to keep the checkboxes hierarchical as in the example above, but the titles in the h3 tags are parent terms and I do not want these as checkboxes, how do I do all this? :)</p>