forked from codehaiku/reference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreference-wordpress-knowledgebase.php
More file actions
90 lines (71 loc) · 2.39 KB
/
reference-wordpress-knowledgebase.php
File metadata and controls
90 lines (71 loc) · 2.39 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
81
82
83
84
85
86
87
88
89
90
<?php
/**
*
* Plugin Name: Reference Knowledgebase and Docs
* Plugin URI: https://wordpress.org/plugins/reference-wordpress-knowledgebase/
* Description: A lightweight knowledgebase plugin for your WordPress website. Works with any theme.
* Version: 1.0.0
* Author: Dunhakdis
* Author URI: https://profiles.wordpress.org/dunhakdis/
* Text Domain: reference
* Domain Path: /languages
* License: GPL2
*
* @category Loaders
* @package Reference WordPress Knowledgebase Plugin
* @author DUNHAKDIS <info@dunhakdis.com>
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html GPL2
* @link <http://dunhakdis.com>
* @since 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
return;
}
define( 'REFERENCE_DIR_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'REFERENCE_PATH', plugin_dir_path( __FILE__ ) );
register_activation_hook(__FILE__, 'run_activator');
function run_activator() {
$plugin = new \DSC\Reference\Activator();
$plugin->activate();
}
function reference_flush_rewrite_rules() {
flush_rewrite_rules();
}
register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );
register_activation_hook( __FILE__, 'reference_flush_rewrite_rules' );
/**
* The code that runs during plugin activation.
*/
require_once plugin_dir_path( __FILE__ ) . 'classes/reference-activator.php';
/**
* The code that runs during plugin deactivation.
*/
// require_once plugin_dir_path( __FILE__ ) . 'classes/reference-deactivator.php';
/**
* The helper class.
*/
require_once plugin_dir_path( __FILE__ ) . 'classes/reference-helper.php';
/**
*This action is documented in classes/reference-activator.php
*/
// register_activation_hook( __FILE__, array( 'Activator', 'activate' ) );
/**
*This action is documented in classes/reference-deactivator.php
*/
// register_activation_hook( __FILE__, array( 'Deactivator', 'deactivate' ) );
require_once plugin_dir_path( __FILE__ ) . 'classes/reference-loader.php';
require_once plugin_dir_path( __FILE__ ) . 'template-tags/template-tags.php';
/**
* This functions executes the plugin
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_loader() {
$plugin = new \DSC\Reference\Loader();
$plugin->runner();
}
run_loader();