Function Reference: geodir_sort_terms
Summary
Sort terms either by post count or review count.
Package
GeoDirectory
Parameters
- $terms
- (array) (required) An array of term objects.
- Default: None
- $sort
- (string) (required) The sort type. Can be count (Post Count) or review_count. count.
- Default:
Return Values
- (array)
- Sorted terms array.
Change Log
Since: 1.0.0
Source File
geodir_sort_terms() is located in geodirectory-functions/general_functions.php [Line: 4200]
Source Code
function geodir_sort_terms( $terms, $sort = 'count' ) { if ( $sort == 'count' ) { return geodir_sort_terms_by_count( $terms ); } if ( $sort == 'review_count' ) { return geodir_sort_terms_by_review_count( $terms ); } return $terms; }