-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_manager_plugin.php
More file actions
57 lines (51 loc) · 1.24 KB
/
Copy pathtask_manager_plugin.php
File metadata and controls
57 lines (51 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
49
50
51
52
53
54
55
56
57
<?php
/**
* Plugin Name: Task Manager
* Plugin URI: https://yourwebsite.com
* Description: A custom WordPress plugin to manage daily tasks.
* Version: 1.0.0
* Author: Hamza Naeem
* Author URI: https://yourwebsite.com
* License: GPL2
*/
if(!defined("ABSPATH"))
{
exit;
}
class TMPlugin{
public function __construct()
{
$this->define_constants();
$this->init_hooks();
$this->includes();
}
private function define_constants()
{
define("TMPLUGIN_VERSION", "1.0");
define("TMPLUGIN_DIR_PATH", plugin_dir_path(__FILE__));
define("TMPLUGIN_DIR_URL", plugin_dir_url(__FILE__));
}
private function init_hooks()
{
register_activation_hook(__FILE__, array($this, "activate"));
register_deactivation_hook(__FILE__, array($this, "deactivate"));
}
private function includes()
{
require_once TMPLUGIN_DIR_PATH . "includes/class_task_manager_form_plugin.php";
new TMFrontend();
}
public function activate()
{
flush_rewrite_rules();
}
public function deactivate()
{
flush_rewrite_rules();
}
}
function task_manager_plugin_init()
{
return new TMPlugin();
}
task_manager_plugin_init();