-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboilerplate.php
45 lines (37 loc) · 1.6 KB
/
boilerplate.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
<?php
/**
* Plugin Name: {{BPREPLACENAME}}
* Plugin URI: https://github.com/{{BPREPLACEGITHUB}}/{{BPREPLACESLUG}}
* Description: {{BPREPLACEDESCRIPTION}}
* Version: 1.0.0
* Author: {{BPREPLACEAUTHOR}}
* Author URI: https://github.com/{{BPREPLACEGITHUB}}
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: {{BPREPLACESLUG}}
* Domain Path: /languages
*/
// Protect agains direct file access
if (! defined('WPINC')) {
die;
}
define('{{BPREPLACECAPSCONSTANT}}_PATH', plugin_dir_path(__FILE__));
define('{{BPREPLACECAPSCONSTANT}}_URL', plugins_url('', __FILE__));
define('{{BPREPLACECAPSCONSTANT}}_TEMPLATE_PATH', {{BPREPLACECAPSCONSTANT}}_PATH . 'templates/');
define('{{BPREPLACECAPSCONSTANT}}_TEXT_DOMAIN', '{{BPREPLACESLUG}}');
load_plugin_textdomain({{BPREPLACECAPSCONSTANT}}_TEXT_DOMAIN, false, {{BPREPLACECAPSCONSTANT}}_PATH . '/languages');
require_once {{BPREPLACECAPSCONSTANT}}_PATH . 'Public.php';
// Register the autoloader
require __DIR__ . '/vendor/autoload.php';
// Acf auto import and export
add_action('acf/init', function () {
$acfExportManager = new \AcfExportManager\AcfExportManager();
$acfExportManager->setTextdomain('{{BPREPLACESLUG}}');
$acfExportManager->setExportFolder({{BPREPLACECAPSCONSTANT}}_PATH . 'source/php/AcfFields/');
$acfExportManager->autoExport(array(
'{{BPREPLACESLUG}}-settings' => 'group_61ea7a87e8aaa' //Update with acf id here, settings view
));
$acfExportManager->import();
});
// Start application
new {{BPREPLACENAMESPACE}}\App();