-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreplace-me.php
More file actions
80 lines (71 loc) · 1.98 KB
/
Copy pathreplace-me.php
File metadata and controls
80 lines (71 loc) · 1.98 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
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* The plugin bootstrap file.
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. It also sets up the activation and deactivation hooks and initialises
* the plugin.
*
* @see https://formewp.github.io
* @since 1.0.0
*
* @package ReplaceMePlugin
*
* @wordpress-plugin
* Plugin Name: Replace Me
* Plugin URI: https://formewp.github.io
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
* Version: 1.0.0
* Author: Moussa Clarke
* Author URI: https://formewp.github.io
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: replace-me
* Domain Path: /languages
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
exit;
}
/*
* Bootstrap forme framework
*
**/
\Forme\bootstrap();
/**
* Include routes.
*/
include_once __DIR__ . '/routes/routes.php';
/**
* Plugin activation.
*/
function activate_replace_me(): void
{
\Forme\getInstance('\VendorName\ReplaceMePlugin\Core\Activator')->activate();
}
/**
* Plugin deactivation.
*/
function deactivate_replace_me(): void
{
\Forme\getInstance('\VendorName\ReplaceMePlugin\Core\Deactivator')->deactivate();
}
/*
* Hooks
*/
register_activation_hook(__FILE__, 'activate_replace_me');
register_deactivation_hook(__FILE__, 'deactivate_replace_me');
/*
* Activation admin Notices
*/
add_action('admin_notices', function () {
$messages = get_transient('replace-me-admin-messages');
if ($messages) {
foreach ($messages as $message) {
echo \Forme\getInstance('VendorName\\ReplaceMePlugin\\Core\\View')->render('admin-message', $message);
}
delete_transient('replace-me-admin-messages');
}
});
$vendorNameReplaceMePluginPlugin = \Forme\getInstance('VendorName\\ReplaceMePlugin\\Main');
$vendorNameReplaceMePluginPlugin->run();