-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
68 lines (58 loc) · 1.86 KB
/
Copy pathplugin.php
File metadata and controls
68 lines (58 loc) · 1.86 KB
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
60
61
62
63
64
65
66
67
68
<?php
/**
* Plugin Name: WordPress Plugin Boilerplate
* Plugin URI: https://GitHub.com/FourteenDev/wordpress-plugin-boilerplate
* Description: A boilerplate plugin for WordPress.
* Version: 3.3.0
* Author: Fourteen Development
* Author URI: https://Fourteen.dev/
* License: MIT
* License URI: https://opensource.org/license/mit/
* Text Domain: wordpress-boilerplate-plugin
* Domain Path: /languages
*/
use WordPressBoilerplatePlugin\Container;
use WordPressBoilerplatePlugin\Core;
if (!defined('ABSPATH')) return;
define('FDWPBP_VERSION', '3.3.0');
define('FDWPBP_FILE', __FILE__);
define('FDWPBP_URL', plugin_dir_url(FDWPBP_FILE));
define('FDWPBP_DIR', plugin_dir_path(FDWPBP_FILE));
define('FDWPBP_BASENAME', plugin_basename(FDWPBP_FILE));
define('FDWPBP_MENUS_SLUG', 'fdwpbp');
define('FDWPBP_OPTIONS_KEY_DB_VERSION', 'fdwpbp_db_version');
require_once 'vendor/autoload.php';
require_once 'functions.php';
// Uncomment this to check for a required plugin/function before calling the core class
/* if (!function_exists('get_field'))
{
add_action('admin_notices', function ()
{
?>
<div class="notice notice-error">
<p><?php esc_html_e('WordPress Plugin Boilerplate: Please enable ACF plugin!', 'wordpress-boilerplate-plugin'); ?></p>
</div>
<?php
});
return;
} */
// Initialize container and bind Core class
$fdwpbpContainer = new Container();
$fdwpbpContainer->singleton(Container::class, function() use ($fdwpbpContainer) { return $fdwpbpContainer; });
$fdwpbpContainer->singleton(Core::class);
// Initialize the core
$core = $fdwpbpContainer->make(Core::class);
/**
* Returns the core class of the plugin.
*
* @global Container $fdwpbpContainer
*
* @return Core
*/
function FDWPBP()
{
global $fdwpbpContainer;
if (!$fdwpbpContainer) return null; // Happens only when activating the plugin
return $fdwpbpContainer->make(Core::class);
}
FDWPBP();