title: Wordpress sort category dropdown list?
body: <p>I am using User-Submitted-Posts Plugin in order to let users submit their images to my wordpress site. Each image is uploaded within a category. The categories are set in the wordpress admin area and are pulled into the submission form using the following code. </p>
  
  <p>My only problem is that this web form pulls the categories through ordered by their category ID not in alphabetical order. Therefore when i ADD a category even if it begins with the letter A, it will appear at the bottom. </p>
  
  <p>Can anyone let me know how to edit the following code to make all categories list in ASC alphabetical order?</p>
  
  <pre><code> &lt;li class="usp_category"&gt;
                  &lt;label for="user-submitted-category" class="usp_label"&gt;&lt;?php _e('Categories'); ?&gt;&lt;/label&gt;
                  &lt;div&gt; 
                      &lt;select class="usp_select" name="user-submitted-category" id="user-submitted-category"&gt;
  
                          &lt;?php foreach($settings['categories'] as $categoryId) { $category = get_category($categoryId); if(!$category) { continue; } ?&gt;
                          &lt;option class="usp_option" value="&lt;?php echo $categoryId;?&gt; "&gt;&lt;?php $category = get_category($categoryId); echo htmlentities($category-&gt;name); ?&gt;&lt;/option&gt;
                          &lt;?php } ?&gt;
                      &lt;/select&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
  </code></pre>