evolve_discussion_title

Evolve_discussion_title().

Description

evolve_discussion_title( (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_discussion_title' ) ) { 
  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_discussion_title($type, $echo); 
  12.  

Defined (1)

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

/library/functions/comments.php  
  1. function evolve_discussion_title($type = NULL, $echo = true) { 
  2. if (!$type) 
  3. return; 
  4.  
  5. $discussion_title = ''; 
  6.  
  7. $comment_count = evolve_count('comment', false); 
  8. $ping_count = evolve_count('pings', false); 
  9.  
  10. switch ($type) { 
  11. case 'comment' : 
  12. $count = $comment_count; 
  13. $many = apply_filters('evolve_many_comments', __('% Comments', 'evolve')); // Available filter: evolve_many_comments 
  14. $none = apply_filters('evolve_no_comments', __('No Comments Yet', 'evolve')); // Available filter: evolve_no_comments 
  15. $one = apply_filters('evolve_one_comment', __('1 Comment', 'evolve')); // Available filter: evolve_one_comment 
  16. break; 
  17. case 'pings' : 
  18. $count = $ping_count; 
  19. $many = apply_filters('evolve_many_pings', __('% Pings/Trackbacks', 'evolve')); // Available filter: evolve_many_pings 
  20. $none = apply_filters('evolve_no_pings', __('No Pings/Trackbacks Yet', 'evolve')); // Available filter: evolve_no_pings 
  21. $one = apply_filters('evolve_one_ping', __('1 Ping/Trackback', 'evolve')); // Available filter: evolve_one_comment 
  22. break; 
  23.  
  24. if ($count > 1) { 
  25. $number = str_replace('%', number_format_i18n($count), $many); 
  26. } elseif ($count == 1) { 
  27. $number = $one; 
  28. } else { // it must be one 
  29. $number = $none; 
  30.  
  31. // Now let's format this badboy. 
  32. $tag = apply_filters('evolve_discussion_title_tag', (string) 'h3'); // Available filter: evolve_discussion_title_tag 
  33.  
  34. if ($number) { 
  35. $discussion_title = '<' . $tag . ' class="' . $type . '-title">'; 
  36. $discussion_title .= '<span class="' . $type . '-title-meta">' . $number . '</span>'; 
  37. $discussion_title .= '</' . $tag . '>'; 
  38. $evolve_discussion_title = apply_filters('evolve_discussion_title', (string) $discussion_title); // Available filter: evolve_discussion_title 
  39. return ( $echo ) ? print( $evolve_discussion_title) : $evolve_discussion_title;