evolve_get_terms

Evolve_get_terms() Returns other terms except the current one (redundant).

Description

evolve_get_terms( (constant) $term = NULL, (string) $glue = ', ' ); 

Parameters (2)

0. $term — Optional. (constant) => NULL
The term.
1. $glue — Optional. (string) => ', '
The glue.

Usage

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

Defined (1)

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

/library/functions/functions.php  
  1. function evolve_get_terms($term = NULL, $glue = ', ') { 
  2. if (!$term) 
  3. return; 
  4.  
  5. $separator = "\n"; 
  6. switch ($term): 
  7. case 'cats': 
  8. $current = single_cat_title('', false); 
  9. $terms = get_the_category_list($separator); 
  10. break; 
  11. case 'tags': 
  12. $current = single_tag_title('', '', false); 
  13. $terms = get_the_tag_list('', "$separator", ''); 
  14. break; 
  15. endswitch; 
  16. if (empty($terms)) 
  17. return; 
  18.  
  19. $thing = explode($separator, $terms); 
  20. foreach ($thing as $i => $str) { 
  21. if (strstr($str, ">$current<")) { 
  22. unset($thing[$i]); 
  23. break; 
  24. if (empty($thing)) 
  25. return false; 
  26.  
  27. return trim(join($glue, $thing));