Repository navigation
Expand file tree
/
Copy pathecoursity.php
More file actions
72 lines (57 loc) · 1.59 KB
/
Copy pathecoursity.php
File metadata and controls
72 lines (57 loc) · 1.59 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
<?php
declare(strict_types=1);
use Ecoursity\App\Models\File;
use Ecoursity\App\Models\Section;
/**
* Plugin Name: Ecoursity
* Plugin URI: https://ecourse.velocitydeveloper.com
* Description: Plugin LMS modern untuk WordPress.
* Version: 0.1.0
* Requires at least: 6.0
* Requires PHP: 8.2
* Author: Velocity Developer
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: ecoursity
*/
if (! defined('ABSPATH')) {
exit;
}
require_once __DIR__ . '/vendor/autoload.php';
if (! defined('ECOURSITY_FILE')) {
define('ECOURSITY_FILE', __FILE__);
}
if (! defined('ECOURSITY_PATH')) {
define('ECOURSITY_PATH', plugin_dir_path(__FILE__));
}
if (! defined('ECOURSITY_URL')) {
define('ECOURSITY_URL', plugin_dir_url(__FILE__));
}
if (! defined('ECOURSITY_VERSION')) {
define('ECOURSITY_VERSION', '0.1.0');
}
final class EcoursityPlugin
{
public function boot(): void
{
add_action('plugins_loaded', [$this, 'loadTextDomain']);
}
public function loadTextDomain(): void
{
load_plugin_textdomain('ecoursity', false, dirname(plugin_basename(__FILE__)) . '/languages');
}
public static function activate(): void
{
Section::createTables();
File::createTable();
flush_rewrite_rules();
}
public static function deactivate(): void
{
flush_rewrite_rules();
}
}
register_activation_hook(__FILE__, [EcoursityPlugin::class, 'activate']);
register_deactivation_hook(__FILE__, [EcoursityPlugin::class, 'deactivate']);
(new EcoursityPlugin())->boot();
(new Ecoursity\App\Init())->boot();