Advertisement
Guest User

maps

a guest
Oct 2nd, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. function setBGMPDefaultIconByCategory( $iconURL, $placemarkID )
  2. {
  3. $placemarkCategories = wp_get_object_terms( $placemarkID, 'bgmp-category' );
  4.  
  5. foreach( $placemarkCategories as $pc )
  6. {
  7. switch( $pc->slug )
  8. {
  9. case 'definite':
  10. $iconURL = get_bloginfo( 'stylesheet_directory' ) . '/images/definite.png';
  11. break;
  12.  
  13. case 'definite-scheduled':
  14. $iconURL = get_bloginfo( 'stylesheet_directory' ) . '/images/definitescheduled.png';
  15. break;
  16.  
  17. case 'past':
  18. $iconURL = get_bloginfo( 'stylesheet_directory' ) . '/images/past.png';
  19. break;
  20.  
  21. case 'possible':
  22. $iconURL = get_bloginfo( 'stylesheet_directory' ) . '/images/possible.png';
  23. break;
  24.  
  25. case 'likely':
  26. $iconURL = get_bloginfo( 'stylesheet_directory' ) . '/images/likely.png';
  27. break;
  28.  
  29. default:
  30. $iconURL = get_bloginfo( 'stylesheet_directory' ) . '/images/marker-icons/pin.png';
  31. break;
  32. }
  33. }
  34.  
  35. return $iconURL;
  36. }
  37. add_filter( 'bgmp_default-icon', 'setBGMPDefaultIcon', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement