Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Map Type split values attitube bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
polupraneeth committed Jun 4, 2020
1 parent 3cec32a commit fead0a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion example-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ function cmb2_ext_demo_metabox()
'id' => $prefix . 'location',
'tab' => 'general',
'type' => 'map',
//'api_key' => 'KEY',
// 'split_values' => true, // Save latitude and longitude as two separate fields
) );

Expand Down
6 changes: 3 additions & 3 deletions includes/CMB_Extension_Field_Sanitize.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public function default_sanitization($override_value, $value, $object_id, $field
case 'visual_style_editor':
$sanitized_value = $this->order($override_value, $value, $object_id, $field_args, $sanitizer);
break;
case 'location':
$sanitized_value = $this->location($override_value, $value, $object_id, $field_args, $sanitizer);
case 'map':
$sanitized_value = $this->map($override_value, $value, $object_id, $field_args, $sanitizer);
break;
default:
// We'll fallback to 'value'
Expand Down Expand Up @@ -81,7 +81,7 @@ protected function order($override_value, $value, $object_id, $field_args, $sani
return $value;
}

protected function location($override_value, $value, $object_id, $field_args, $sanitizer)
protected function map($override_value, $value, $object_id, $field_args, $sanitizer)
{
if (isset($field_args['split_values']) && $field_args['split_values']) {
if (!empty($value['latitude'])) {
Expand Down

0 comments on commit fead0a0

Please sign in to comment.