public function saveLocation()
    {
        if ($this->location != null) {
            if (!empty($this->location['parent']) && $this->location['parent']['id'] > 0) {
                $this->location['title'] = $this->location['parent']['title'].', '.$this->location['title'];
            }

            if (!empty($location['latitude']) && !empty($location['longitude'])) {
                update_post_meta($this->ID, 'latitude', $location['latitude']);
                update_post_meta($this->ID, 'longitude', $location['longitude']);
            }
            update_post_meta($this->ID, 'location', $this->location);
        }
    }
public function saveLocation()
    {
        if ($this->location != null) {
            if (!empty($this->location['parent']) && $this->location['parent']['id'] > 0) {
                $this->location['title'] = $this->location['parent']['title'].', '.$this->location['title'];
            }

            if (!empty($location['latitude']) && !empty($location['longitude'])) {
                update_post_meta($this->ID, 'latitude', $location['latitude']);
                update_post_meta($this->ID, 'longitude', $location['longitude']);
            }
            update_post_meta($this->ID, 'location', $this->location);
        }
    }
public function saveLocation ( ) { if ( $ this -> location != null ) { if ( ! empty ( $ this -> location [ 'parent' ] ) && $ this -> location [ 'parent' ] [ 'id' ] > 0 ) { $ this -> location [ 'title' ] = $ this -> location [ 'parent' ] [ 'title' ] . ', ' . $ this -> location [ 'title' ] ; } if ( ! empty ( $ location [ 'latitude' ] ) && ! empty ( $ location [ 'longitude' ] ) ) { update_post_meta ( $ this -> ID , 'latitude' , $ location [ 'latitude' ] ) ; update_post_meta ( $ this -> ID , 'longitude' , $ location [ 'longitude' ] ) ; } update_post_meta ( $ this -> ID , 'location' , $ this -> location ) ; } }
Saves location as meta data
@return void
Saves location as meta data