-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocsify-docs.php
More file actions
executable file
·58 lines (48 loc) · 1.53 KB
/
Copy pathdocsify-docs.php
File metadata and controls
executable file
·58 lines (48 loc) · 1.53 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
<?php
/**
* @wordpress-plugin
*
* Plugin Name: Docsify Docs
* Plugin URI: https://github.com/jeffersonrucu/WP_Docsify
* Description: Integrate Docsify documentation into WordPress using a custom page template with role-based access control and admin settings.
* Version: 3.3.1
* Requires at least: 5.9
* Requires PHP: 7.4
* Author: Jefferson Oliveira, Studio STG
* Author URI: https://github.com/jeffersonrucu
* License: GPL-2.0+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: docsify-docs
* Domain Path: /languages
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
spl_autoload_register(
function ( $class_name ) {
$prefix = 'DocsifyDocs\\';
$base_dir = __DIR__ . '/src/';
$len = strlen( $prefix );
if ( strncmp( $prefix, $class_name, $len ) !== 0 ) {
return;
}
$relative_class = substr( $class_name, $len );
$file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php';
if ( file_exists( $file ) ) {
require $file;
}
}
);
require_once __DIR__ . '/config.php';
use DocsifyDocs\Activator;
use DocsifyDocs\Deactivator;
use DocsifyDocs\Core;
register_activation_hook( __FILE__, [ Activator::class, 'activate' ] );
register_deactivation_hook( __FILE__, [ Deactivator::class, 'deactivate' ] );
add_action(
'plugins_loaded',
function () {
$plugin = new Core();
$plugin->run();
}
);