-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmodularity-form-builder.php
42 lines (35 loc) · 1.5 KB
/
modularity-form-builder.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
<?php
/*
* Plugin Name: Modularity Form Builder
* Plugin URI: http://github.com/helsingborg-stad
* Description: Build submittable form(s) to display with module
* Version: 3.3.1
* Author: Kristoffer Svanmark, Sebastian Thulin
*/
use ModularityFormBuilder\Blade\Blade;
use ComponentLibrary\Init as ComponentLibraryInit;
define('FORM_BUILDER_MODULE_PATH', plugin_dir_path(__FILE__));
define('FORM_BUILDER_MODULE_URL', plugins_url('', __FILE__));
define('FORM_BUILDER_MODULE_TEMPLATE_PATH', FORM_BUILDER_MODULE_PATH . 'templates/');
define('FORM_BUILDER_MODULE_VIEW_PATH', FORM_BUILDER_MODULE_PATH . 'source/php/Module/views');
//Load lang
load_plugin_textdomain('modularity-form-builder', false, plugin_basename(dirname(__FILE__)) . '/languages');
require_once FORM_BUILDER_MODULE_PATH . 'Public.php';
if (file_exists(FORM_BUILDER_MODULE_PATH . 'vendor/autoload.php')) {
require_once FORM_BUILDER_MODULE_PATH . 'vendor/autoload.php';
}
$bladeInstance = new Blade(new ComponentLibraryInit([]));
// Acf auto import and export
add_action('plugins_loaded', function () {
$acfExportManager = new \AcfExportManager\AcfExportManager();
$acfExportManager->setTextdomain('modularity-form-builder');
$acfExportManager->setExportFolder(FORM_BUILDER_MODULE_PATH . 'acf-fields/');
$acfExportManager->autoExport(array(
'form' => 'group_58eb301ecb36a',
));
$acfExportManager->import();
});
// Start application
if (function_exists('get_field')) {
new ModularityFormBuilder\App($bladeInstance);
}