-
Notifications
You must be signed in to change notification settings - Fork 1
/
modularity-json-render.php
executable file
·53 lines (45 loc) · 1.83 KB
/
modularity-json-render.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
<?php
/**
* Plugin Name: Modularity Json Render
* Plugin URI: https://github.com/helsingborg-stad/modularity-json-render
* Description: Renders JSON api:s as a list etc.
* Version: 3.0.5
* Author: Sebastian Thulin, Jonatan Hanson
* Author URI: https://github.com/sebastianthulin
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: modularity-json-render
* Domain Path: /languages
*/
// Protect agains direct file access
if (! defined('WPINC')) {
die;
}
define('MODULARITYJSONRENDER_PATH', plugin_dir_path(__FILE__));
define('MODULARITYJSONRENDER_URL', plugins_url('', __FILE__));
define('MODULARITYJSONRENDER_MODULE_VIEW_PATH', plugin_dir_path(__FILE__) . 'source/php/Module/views');
define('MODULARITYJSONRENDER_TEMPLATE_PATH', MODULARITYJSONRENDER_PATH . 'templates/');
load_plugin_textdomain('modularity-json-render', false, plugin_basename(dirname(__FILE__)) . '/languages');
// Autoload from plugin
if (file_exists(MODULARITYJSONRENDER_PATH . 'vendor/autoload.php')) {
require_once MODULARITYJSONRENDER_PATH . 'vendor/autoload.php';
}
require_once MODULARITYJSONRENDER_PATH . 'Public.php';
add_filter( '/Modularity/externalViewPath', function($arr)
{
$arr['mod-json-render'] = MODULARITYJSONRENDER_MODULE_VIEW_PATH;
return $arr;
}, 10, 3
);
// Acf auto import and export
add_action('plugins_loaded', function () {
$acfExportManager = new \AcfExportManager\AcfExportManager();
$acfExportManager->setTextdomain('modularity-json-render');
$acfExportManager->setExportFolder(MODULARITYJSONRENDER_PATH . 'acf-fields/');
$acfExportManager->autoExport(array(
'display-settings' => 'group_5bed3c2a60bb7',
));
$acfExportManager->import();
});
// Start application
new ModularityJsonRender\App();