-
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.96 KB
/
Copy pathplugin.php
File metadata and controls
68 lines (58 loc) · 1.96 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: Telegram Bot WordPress Plugin Boilerplate
* Plugin URI: https://GitHub.com/FourteenDev/telegram-bot-wordpress-plugin-boilerplate
* Description: A boilerplate plugin for connecting a Telegram bot to your WordPress website.
* Version: 3.2.0
* Author: Fourteen Development
* Author URI: https://Fourteen.dev/
* License: MIT
* License URI: https://opensource.org/license/mit/
* Text Domain: telegram-plugin-boilerplate
* Domain Path: /languages
*/
use TelegramPluginBoilerplate\Container;
use TelegramPluginBoilerplate\Core;
if (!defined('ABSPATH')) return;
define('FDTBWPB_VERSION', '3.2.0');
define('FDTBWPB_FILE', __FILE__);
define('FDTBWPB_URL', plugin_dir_url(FDTBWPB_FILE));
define('FDTBWPB_DIR', plugin_dir_path(FDTBWPB_FILE));
define('FDTBWPB_BASENAME', plugin_basename(FDTBWPB_FILE));
define('FDTBWPB_MENUS_SLUG', 'fdtbwpb');
define('FDTBWPB_OPTIONS_KEY_DB_VERSION', 'fdtbwpb_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('Telegram Bot WordPress Plugin Boilerplate: Please enable ACF plugin!', 'telegram-plugin-boilerplate'); ?></p>
</div>
<?php
});
return;
} */
// Initialize container and bind Core class
$fdtbwpbContainer = new Container();
$fdtbwpbContainer->singleton(Container::class, function() use ($fdtbwpbContainer) { return $fdtbwpbContainer; });
$fdtbwpbContainer->singleton(Core::class);
// Initialize the core
$core = $fdtbwpbContainer->make(Core::class);
/**
* Returns the core class of the plugin.
*
* @global Container $fdtbwpbContainer
*
* @return Core
*/
function FDTBWPB()
{
global $fdtbwpbContainer;
if (!$fdtbwpbContainer) return null; // Happens only when activating the plugin
return $fdtbwpbContainer->make(Core::class);
}
FDTBWPB();