bb_get_top_tags

Bb_get_top_tags() - Returns most popular tags.

Description

(array|false) bb_get_top_tags( (null) $args = null ); 

Returns (array|false)

Term objects (back-compat), false on failure

Parameters (1)

0. $args — Optional. (null) => null
The args.

Usage

  1. if ( !function_exists( 'bb_get_top_tags' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php'; 
  3.  
  4. // The args. 
  5. $args = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_top_tags($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php  
  1. function bb_get_top_tags( $args = null ) { 
  2. global $wp_taxonomy_object; 
  3.  
  4. $args = wp_parse_args( $args, array( 'number' => 40 ) ); 
  5. $args['order'] = 'DESC'; 
  6. $args['orderby'] = 'count'; 
  7.  
  8. $terms = $wp_taxonomy_object->get_terms( 'bb_topic_tag', $args ); 
  9. if ( is_wp_error( $terms ) ) 
  10. return false; 
  11.  
  12. foreach ( $terms as $term ) 
  13. _bb_make_tag_compat( $term ); 
  14.  
  15. return $terms;