Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function get_terms_grades_dropdown($taxonomies, $args)
  2. {
  3. global $search_values;
  4.  
  5. $myterms = get_terms($taxonomies, $args);
  6. $output = "";
  7. foreach ($myterms as $term) {
  8. $root_url = get_bloginfo('url');
  9. $term_taxonomy = $term->grades;
  10. $term_slug = $term->slug;
  11. $term_name = $term->name;
  12. $value = $term->term_id;
  13. if ($search_values['grades'] == $term->slug) {
  14. $selected = "selected='selected'";
  15. } else {
  16. $selected = '';
  17. }
  18. $output .= "<option value='" . $value . "' " . $selected . ">" . $term_name . "</option>";
  19. }
  20.  
  21. return $output;
  22. }
  23.  
  24. if ($search_values['grades'] == $term->slug) {
  25. $selected = "selected='selected'";
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement