-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
65 lines (39 loc) · 1.69 KB
/
index.php
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
<?php
/*
Plugin Name: The plugin flat scheme
Description: The scheme to how to make a plugin, save data, set informations
Version: 1.0
Author: Bertz.tech - Alberto Marà
Author URI: https://bertz.tech
*/
class the_plugin_scheme {
/* = = = = = = = = = = = = = = = = = = = = = = */
function __construct () {
// set new menu items and page hook,
// all info: https://codex.wordpress.org/Administration_Menus
add_action( 'admin_menu', array($this, 'init_admin_panel') );
}
/* = = = = = = = = = = = = = = = = = = = = = = */
// start the main page
function init_admin_panel () {
// a different way is: add_menu_page
// https://developer.wordpress.org/reference/functions/add_menu_page/
// SET PAGE CONTENTS
add_options_page(
// the page title
'The scheme test',
// the title in menu
'hello plugins scheme',
// the securety level : shorturl.at/sxHWY
'activate_plugins',
// the plugin slug
'the-scheme-test',
// contents printer
array($this,'write_page')
);
}
function write_page () {
require 'contents.php'; //rememeber to copy slug of plugin/page inside this file!
}
/* = = = = = = = = = = = = = = = = = = = = = = */
} $the_plugin_scheme = new the_plugin_scheme();