-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfortune-p.php
More file actions
48 lines (41 loc) · 1.24 KB
/
fortune-p.php
File metadata and controls
48 lines (41 loc) · 1.24 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
<?php
/**
* Plugin Name: Events Manager
* Plugin URI: https://example.com/
* Description: Кастомный тип записей "Событие" с шорткодом и интерактивными картами (Yandex).
* Version: 1.1.0
* Author: Test Developer
* License: GPL v2 or later
* Text Domain: fortune-p
* Domain Path: /languages
*/
// Защита от прямого доступа
if (!defined('ABSPATH')) {
exit;
}
define('FORTUNE_P_VERSION', '1.1.0');
define('FORTUNE_P_PATH', plugin_dir_path(__FILE__));
define('FORTUNE_P_URL', plugin_dir_url(__FILE__));
// Загрузка автозагрузчика PSR-4
require_once FORTUNE_P_PATH . 'src/Autoloader.php';
/**
* Функция-обертка для получения экземпляра плагина.
*
* @return \FortuneP\EventsManager\Plugin
*/
function fortune_p_events()
{
return \FortuneP\EventsManager\Plugin::get_instance();
}
/**
* Инициализация плагина.
*/
add_action('plugins_loaded', function () {
fortune_p_events()->init(__FILE__);
});
register_activation_hook(__FILE__, function () {
fortune_p_events()->activate();
});
register_deactivation_hook(__FILE__, function () {
flush_rewrite_rules();
});