evolve_count

Evolve_count().

Description

evolve_count( (constant) $type = NULL, (constant) $echo = true ); 

Parameters (2)

0. $type — Optional. (constant) => NULL
The type.
1. $echo — Optional. (constant) => true
The echo.

Usage

  1. if ( !function_exists( 'evolve_count' ) ) { 
  2. require_once '/library/functions/comments.php'; 
  3.  
  4. // The type. 
  5. $type = NULL; 
  6.  
  7. // The echo. 
  8. $echo = true; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = evolve_count($type, $echo); 
  12.  

Defined (1)

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

/library/functions/comments.php  
  1. function evolve_count($type = NULL, $echo = true) { 
  2. if (!$type) 
  3. return; 
  4. global $wp_query; 
  5.  
  6. $comment_count = $wp_query->comment_count; 
  7. $ping_count = count($wp_query->comments_by_type['pings']); 
  8.  
  9. switch ($type): 
  10. case 'comment': 
  11. return ( $echo ) ? print( $comment_count) : $comment_count; 
  12. break; 
  13. case 'pings': 
  14. return ( $echo ) ? print( $ping_count) : $ping_count; 
  15. break; 
  16. endswitch;