-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.php
41 lines (35 loc) · 1.36 KB
/
plugin.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
<?php
/**
* Plugin Name: WordPress Plugin Boilerplate
* Plugin URI: https://horttcore.de
* Description: A WordPress Plugin Boilerplate
* Author: Ralf Hortt
* Author URI: https://horttcore.de
* Text Domain: wordpress-plugin-boilerplate
* Domain Path: /languages
* Version: 1.1
*
* @package Horttcore/WordPressPluginBoilerplate
*/
namespace RalfHortt\WordPressPluginBoilerplate;
use RalfHortt\Plugin\PluginFactory;
use RalfHortt\TranslatorService\Translator;
// ------------------------------------------------------------------------------
// Prevent direct file access
// ------------------------------------------------------------------------------
if (!defined('WPINC')) :
die;
endif;
// ------------------------------------------------------------------------------
// Autoloader
// ------------------------------------------------------------------------------
$autoloader = dirname(__FILE__).'/vendor/autoload.php';
if (is_readable($autoloader)) :
require_once $autoloader;
endif;
// ------------------------------------------------------------------------------
// Bootstrap
// ------------------------------------------------------------------------------
PluginFactory::create()
->addService(Translator::class, 'wordpress-plugin-boilerplate', dirname(plugin_basename(__FILE__)).'/languages/')
->boot();