Make WordPress Core


Ignore:
Timestamp:
04/21/2009 10:13:44 PM (16 years ago)
Author:
ryan
Message:

get_terms_orderby, get_terms_fields, and tag_clooud-sort filters. Props jhodgdon, filosofo. fixes #9004

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r10946 r11037  
    574574 * the 'format' argument will return in PHP array type format.
    575575 *
     576 * The 'tag_cloud_sort' filter allows you to override the sorting done
     577 * by the 'orderby' argument; passed to the filter: $tags array and $args array.
     578 *
    576579 * The 'orderby' argument will accept 'name' or 'count' and defaults to 'name'.
    577580 * The 'order' is the direction to sort, defaults to 'ASC' and can be 'DESC' or
     
    619622        uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') );
    620623
     624        $tags = apply_filters( 'tag_cloud_sort', $tags, $args );
     625   
    621626    if ( 'DESC' == $order )
    622627        $tags = array_reverse( $tags, true );
Note: See TracChangeset for help on using the changeset viewer.