evolve_comment_meta

Evolve_comment_meta() short description.

Description

evolve_comment_meta( ); 

Parameters (1)

0. $meta_format — Optional. (string) => '%date%   %link% %edit%'
The meta format.

Usage

  1. if ( !function_exists( 'evolve_comment_meta' ) ) { 
  2. require_once '/library/functions/comments.php'; 
  3.  
  4. // The meta format. 
  5. $meta_format = '%date%   %link% %edit%'; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = evolve_comment_meta($meta_format); 
  9.  

Defined (1)

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

/library/functions/comments.php  
  1. function evolve_comment_meta($meta_format = '%date%   %link% %edit%') { 
  2. $meta_format = apply_filters('evolve_comment_meta_format', $meta_format); // Available filter: evolve_comment_meta_format 
  3. if (!$meta_format) 
  4. return; 
  5.  
  6. // No keywords to replace 
  7. if (strpos($meta_format, '%') === false) { 
  8. echo $meta_format; 
  9. } else { 
  10. $open = '<!--BEGIN .comment-meta-->' . "\n"; 
  11. $open .= '<div class="comment-meta">' . "\n"; 
  12. $close = "\n" . '<!--END .comment-meta-->' . "\n"; 
  13. $close .= '</div></div>' . "\n"; 
  14.  
  15. // separate the %keywords% 
  16. $meta_array = preg_split('/(%.+?%)/', $meta_format, -1, PREG_SPLIT_DELIM_CAPTURE); 
  17.  
  18. // parse through the keywords 
  19. foreach ($meta_array as $key => $str) { 
  20. switch ($str) { 
  21. case '%date%': 
  22. $meta_array[$key] = evolve_comment_date(); 
  23. break; 
  24.  
  25. case '%time%': 
  26. $meta_array[$key] = evolve_comment_time(); 
  27. break; 
  28.  
  29. case '%link%': 
  30. $meta_array[$key] = evolve_comment_link(); 
  31. break; 
  32.  
  33. case '%reply%': 
  34. $meta_array[$key] = evolve_comment_reply(true); 
  35. break; 
  36.  
  37. case '%edit%': 
  38. $meta_array[$key] = evolve_comment_edit(); 
  39. break; 
  40. $output = join('', $meta_array); 
  41. if ($output) 
  42. echo $open . $output . $close; // output the result