Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. //create map args
  2. function wds_map_build_markers($baja_listings='',$class=''){
  3.      global $post,$wpdb;
  4.      if(!$baja_listings){
  5.         $baja_listings=array($post);
  6.      }
  7.      $x=0;
  8.      //print_r($baja_listings);
  9.      foreach ( $baja_listings as $post ){
  10.         $location_id=$post->ID;
  11.         //echo "location_id: ".$location_id."<br>";
  12.         $address = get_post_meta( $location_id, 'property-address', true );
  13.         $lat = get_post_meta( $location_id, '_wds_map_latitude', true );
  14.         $lng = get_post_meta( $location_id, '_wds_map_longitude', true );
  15.         if($lat && $lng){
  16.             $show_map=1;
  17.             $args[$x]=array($location_id.$class,'','',$lat,$lng,$entry_url,'',$post->post_title,$html);
  18.             $x+=1;
  19.         }
  20.     }
  21.     if($show_map){
  22.         //print_r($args);
  23.         echo wds_map_load_markers($args,'250px','100%','no',$class);
  24.     }  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement