Value=$value; } public function Format($includeLabel=true) { $value=$this->Value->Value; $html=$this->AddLine($this->Value->Value->Address1Label,'Address1'); $html.=$this->AddLine($this->Value->Value->Address2Label,'Address2'); $html.=$this->AddLine($this->Value->Value->CityLabel,'City'); $html.=$this->AddLine($this->Value->Value->StateLabel,'State'); $html.=$this->AddLine($this->Value->Value->ZipLabel,'Zip'); $html.=$this->AddLine($this->Value->Value->CountryLabel,'CountryLong'); if($value->FileName!='') { $dir=wp_get_upload_dir(); $path=$dir['baseurl'].'/rednaowooextraproduct/maps/'.$value->FileName; $html.='Image not available'; } if(isset($value->Markers)) { $markers=ArrayUtils::Filter($value->Markers,function($marker){ return !isset($marker->IsFixed)||$marker->IsFixed==false; }); for($i=0;$i'; $html.=''.(count($markers)>1?'#'.($i+1).": ":'').\esc_html($markers[$i]->Address->FormattedAddress).''; $html.=''; } } return [[ "name"=>$this->Value->Label, 'value'=>$html, 'field'=>$this->Value, 'key'=>$this->Value->Label, 'display'=>$html ]]; } private function AddLine($label,$property) { $value=$this->Value->Value; if(!isset($value->$property)||$value->$property=='') return ''; $value=$value->$property; $section='
'; $section.=''; $section.=''.\esc_html($value).''; $section.='
'; return $section; } }