1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
| <?php
| namespace JVBase\managers\SEO\render\Traits\_Properties;
|
| use JVBase\managers\SEO\render\Thing\Intangible\StructuredValue\GeoCoordinates;
| use JVBase\managers\SEO\render\Thing\Intangible\StructuredValue\GeoShape;
|
| if (!defined('ABSPATH')) {
| exit;
| }
| trait geoTrait {
| /**
| * @var GeoCoordinates|GeoShape The geo coordinates of the place.
| */
| protected GeoCoordinates|GeoShape $geo;
|
| public function getGeo():GeoCoordinates|GeoShape|null
| {
| return $this->geo??null;
| }
| public function setGeo(GeoCoordinates|GeoShape $geo):void
| {
| $this->geo = $geo;
| }
| public function getGeoFieldConfig():array
| {
| return [
| 'type' => 'group',
| 'wrap' => 'details',
| 'label' => 'Coordinates',
| 'fields' => [
| 'latitude' => [
| 'type' => 'text',
| 'label' => 'Latitude',
| 'hint' => 'The latitude of a location. For example 37.42242'
| ],
| 'longitude' => [
| 'type' => 'text',
| 'label' => 'Longitude',
| 'hint' => 'The longitude of a location. For example -122.08585'
| ]
| ]
| ];
| }
| }
|
|