-
Notifications
You must be signed in to change notification settings - Fork 0
/
modularity-open-street-map.php
56 lines (46 loc) · 2.04 KB
/
modularity-open-street-map.php
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
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Plugin Name: Modularity Open Street Map
* Plugin URI: https://github.com/NiclasNorin/modularity-open-street-map
* Description: A map based of OSM.
* Version: 2.6.0
* Author: Niclas Norin
* Author URI: https://github.com/NiclasNorin
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: modularity-open-street-map
* Domain Path: /languages
*/
// Protect agains direct file access
if (! defined('WPINC')) {
die;
}
define('MODULARITYOPENSTREETMAP_PATH', plugin_dir_path(__FILE__));
define('MODULARITYOPENSTREETMAP_URL', plugins_url('', __FILE__));
define('MODULARITYOPENSTREETMAP_TEMPLATE_PATH', MODULARITYOPENSTREETMAP_PATH . 'templates/');
define('MODULARITYOPENSTREETMAP_VIEW_PATH', MODULARITYOPENSTREETMAP_PATH . 'views/');
define('MODULARITYOPENSTREETMAP_MODULE_VIEW_PATH', MODULARITYOPENSTREETMAP_PATH . 'source/php/Module/views');
// Endpoint address
define('OSM_ENDPOINT', 'osm/v1/');
require_once MODULARITYOPENSTREETMAP_PATH . 'Public.php';
// Register the autoloader
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
}
load_plugin_textdomain('modularity-open-street-map', false, plugin_basename(dirname(__FILE__)) . '/languages');
add_filter('/Modularity/externalViewPath', function ($arr) {
$arr['mod-open-street-map'] = MODULARITYOPENSTREETMAP_MODULE_VIEW_PATH;
return $arr;
}, 10, 3);
// Acf auto import and export
add_action('acf/init', function () {
$acfExportManager = new \AcfExportManager\AcfExportManager();
$acfExportManager->setTextdomain('modularity-open-street-map');
$acfExportManager->setExportFolder(MODULARITYOPENSTREETMAP_PATH . 'source/php/AcfFields/');
$acfExportManager->autoExport(array(
'modularity-open-street-map-settings' => 'group_64219abb0caec' //Update with acf id here, settings view
));
$acfExportManager->import();
});
// Start application
new ModularityOpenStreetMap\App();