-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodularity-noticeboard.php
59 lines (48 loc) · 2.36 KB
/
modularity-noticeboard.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
57
58
59
<?php
/**
* Plugin Name: Modularity Digital Noticeboard
* Plugin URI: https://github.com/horby/modularity-noticeboard
* Description: Adds Noticeboard modules to Modularity
* Version: 1.1.0
* Author: Anders Fajerson, Michael Claesson
* Author URI: https://github.com/horby
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: modularity-noticeboard
* Domain Path: /languages
*/
// Protect agains direct file access
if (! defined('WPINC')) {
die;
}
define('MODULARITYNOTICEBOARD_PATH', plugin_dir_path(__FILE__));
define('MODULARITYNOTICEBOARD_URL', plugins_url('', __FILE__));
define('MODULARITYNOTICEBOARD_TEMPLATE_PATH', MODULARITYNOTICEBOARD_PATH . 'templates/');
define('MODULARITYNOTICEBOARD_POST_TYPE', 'announcement');
define('MODULARITYNOTICEBOARD_TAXONOMY', 'announcement_type');
define('MODULARITYNOTICEBOARD_MEETINGDATE_ACF_FIELD', 'field_57db7f7cb2a54');
define('MODULARITYNOTICEBOARD_ANNOUNCEMENT_TYPE_ACF_FIELD', 'field_58bfb86c760e3');
define('MODULARITYNOTICEBOARD_CITY_COUNCIL_SLUG', 'kommunfullmaktiges-sammantrade');
load_plugin_textdomain('modularity-noticeboard', false, plugin_basename(dirname(__FILE__)) . '/languages');
require_once MODULARITYNOTICEBOARD_PATH . 'source/php/Vendor/Psr4ClassLoader.php';
require_once MODULARITYNOTICEBOARD_PATH . 'Public.php';
// Instantiate and register the autoloader
$loader = new ModularityNoticeboard\Vendor\Psr4ClassLoader();
$loader->addPrefix('ModularityNoticeboard', MODULARITYNOTICEBOARD_PATH);
$loader->addPrefix('ModularityNoticeboard', MODULARITYNOTICEBOARD_PATH . 'source/php/');
$loader->register();
// Start application
$modularityNoticeboardApp = new ModularityNoticeboard\App();
// Acf auto import and export
add_action('acf/init', function () {
$acfExportManager = new \AcfExportManager\AcfExportManager();
$acfExportManager->setTextdomain('modularity-noticeboard');
$acfExportManager->setExportFolder(MODULARITYNOTICEBOARD_PATH . 'source/php/AcfFields/');
$acfExportManager->autoExport(array(
'module' => 'group_57da9a06e21a8',
'post-type' => 'group_57db7edf10454',
));
$acfExportManager->import();
});
register_activation_hook(__FILE__, array($modularityNoticeboardApp, 'install'));
register_deactivation_hook(__FILE__, array($modularityNoticeboardApp, 'uninstall'));