title: How to I reorder get_post_types() results alphabetically in WordPress?
body: <p>I'm able to output a list of my custom post types using the code below. How can I order the results alphabetically?</p>
  <pre><code>$args = array(
  'public'   =&gt; true,
  '_builtin' =&gt; false,
  );
  $output = 'names'; // names or objects, note names is the default
  $operator = 'and'; // 'and' or 'or'
  $post_types = get_post_types( $args, $output, $operator ); 
  foreach ( $post_types  as $post_type ) {
  $pts = get_post_type_object( $post_type );
  $post_title = $pts-&gt;labels-&gt;name;
  echo '&lt;li&gt;&lt;a href=&quot;' . get_post_type_archive_link( $post_type ) . '&quot;&gt;' . $post_title . '&lt;/a&gt;&lt;/li&gt;';
  }
  ?&gt;
  </code></pre>