Sorry, but the above answer is lacking a lot of flexibility. wp_tag_cloud()
is going to output a whole slew of HTML, and nothing friendly to manipulate in the PHP.
get_tags()
already has support for orderby
in the input array, since it's a term query (reference: the Codex)
So here's a sample of how you'd do that, and I'm listing the full options below
$tags = get_tags(array(
'taxonomy' => 'post_tag',
'orderby' => 'name',
'hide_empty' => false // for development
));
Big ol' list of all available parameters with their defaults:
$args = array(
'taxonomy' => null,
'object_ids' => null,
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => true,
'include' => array(),
'exclude' => array(),
'exclude_tree' => array(),
'number' => '',
'offset' => '',
'fields' => 'all',
'count' => false,
'name' => '',
'slug' => '',
'term_taxonomy_id' => '',
'hierarchical' => true,
'search' => '',
'name__like' => '',
'description__like' => '',
'pad_counts' => false,
'get' => '',
'child_of' => 0,
'parent' => '',
'childless' => false,
'cache_domain' => 'core',
'update_term_meta_cache' => true,
'meta_query' => '',
'meta_key' => '',
'meta_value' => '',
'meta_type' => '',
'meta_compare' => '',
);