forked from helsingborg-stad/content-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-scheduler.php
47 lines (39 loc) · 1.72 KB
/
content-scheduler.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
<?php
/**
* Plugin Name: Content Scheduler
* Plugin URI: https://github.com/helsingborg-stad/content-scheduler
* Description: Interface for post publishing and unpublisching schedulation
* Version: 1.0.0
* Author: Kristoffer Svanmark, Sebastian Thulin
* Author URI: https://github.com/helsingborg-stad
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: content-scheduler
* Domain Path: /languages
*/
// Protect agains direct file access
if (! defined('WPINC')) {
die;
}
define('CONTENTSCHEDULER_PATH', plugin_dir_path(__FILE__));
define('CONTENTSCHEDULER_URL', plugins_url('', __FILE__));
define('CONTENTSCHEDULER_TEMPLATE_PATH', CONTENTSCHEDULER_PATH . 'templates/');
load_plugin_textdomain('content-scheduler', false, plugin_basename(dirname(__FILE__)) . '/languages');
require_once CONTENTSCHEDULER_PATH . 'vendor/autoload.php';
require_once CONTENTSCHEDULER_PATH . 'source/php/Vendor/Psr4ClassLoader.php';
require_once CONTENTSCHEDULER_PATH . 'Public.php';
// Instantiate and register the autoloader
$loader = new ContentScheduler\Vendor\Psr4ClassLoader();
$loader->addPrefix('ContentScheduler', CONTENTSCHEDULER_PATH);
$loader->addPrefix('ContentScheduler', CONTENTSCHEDULER_PATH . 'source/php/');
$loader->register();
// Acf auto import and export
add_action('plugins_loaded', function () {
$acfExportManager = new AcfExportManager\AcfExportManager();
$acfExportManager->setTextdomain('content-scheduler');
$acfExportManager->setExportFolder(CONTENTSCHEDULER_PATH . 'source/php/AcfFields/');
$acfExportManager->autoExport(array());
$acfExportManager->import();
});
// Start application
new ContentScheduler\App();