Initial commit: WordPress wp-content (themes, plugins, languages)

- Theme: momentry (custom theme with REST API routes)
- Plugins: code-snippets (contains all API proxies)
- Languages: zh_TW translations
- Excludes: cache, backups, uploads, logs
This commit is contained in:
OpenCode
2026-05-29 19:07:56 +08:00
commit 09ef1f000f
6521 changed files with 867163 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<?php
namespace WPForms\Vendor;
class Address
{
public $street;
public $city;
public function getGeoCoords()
{
$data = \file_get_contents('http://nominatim.openstreetmap.org/search?q=' . \urlencode($this->street) . ',' . \urlencode($this->city) . '&format=json&addressdetails=1');
$json = \json_decode($data);
return array('lat' => $json[0]->lat, 'lon' => $json[0]->lon);
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace WPForms\Vendor;
class Contact
{
public $name;
/**
* @var Address
*/
public $address;
}

View File

@@ -0,0 +1,12 @@
<?php
namespace WPForms\Vendor;
require_once __DIR__ . '/../src/JsonMapper.php';
require_once 'Contact.php';
require_once 'Address.php';
$json = \json_decode(\file_get_contents(__DIR__ . '/single.json'));
$mapper = new JsonMapper();
$contact = $mapper->map($json, new Contact());
$coords = $contact->address->getGeoCoords();
echo $contact->name . ' lives at coordinates ' . $coords['lat'] . ',' . $coords['lon'] . "\n";