-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-panel.php
62 lines (60 loc) · 3.56 KB
/
config-panel.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
<?php
/**
* Panel Configuration
*
* $config['panel']['id'] => $options (array)(Required) An array containining the panel options. $options explain below.
* Id must be unique within your namespace.
*
* Ex: $config['panel']['panel1'] => $panel1_options;
* $config['panel']['panel2'] => $panel2_options;
*
* array $options :
*
* 'uses' => (string)(Required) The panel class to use. The class must extends atkwp\components\PanelComponent class.
* Ex: 'uses' => __NAMESPACE__ . '\panels\Event'.
*
* 'type' => (string)(Required) The panel type, Type must be 'panel' or 'sub-panel'.
* A panel of type 'panel' will create an admin page accessible via an admin menu item in WP.
* A panel of type 'sub-panel' will create an admin page accessible via an admin sub menu item in WP.
* - When panel are defined as 'sub-panel' type, they must indicate their 'parent' panel.
*
* 'parent' => (string)(Required when type = 'sub-panel') A string holding the parent id in order to indicate which parent this sub panel belong too.
* Ex: 'panel1'.
*
* 'page' => (string)(Required) A string holding the page title. The title of the page as shown in <title> tag.
*
* 'menu' => (string)(Required) A string holding the name of the menu displayed in the admin dashboard.
*
* 'slug' => (string)(Required) A sting holding the slug name that refer to the menu. Must be unique.
*
* 'capabilities' => (string)(Required) A string holding the minimum capability required to view this panel.
*
* 'icon' => (string)(Optional) A string holding the image path to a custom image for menu icon in dashboard.
* Image path value is relative to your assets directory.
* Ex: icon.png file is located under assets/images/icon.png then the path value should be 'images/icon.png'.
*
* 'position' => (integer)(Optional) An integer holding the menu position in dashboard.
* ONLY applicable for 'panel' type.
*
* 'js' => (array)(Optional) An array of javascript file path (without the extension) to load with the panel.
* File path value is relative to your plugin assets/js directory.
* Ex: test.js file is located under assets/js/vendor/test.js then the path value should be 'vendor/test'.
*
* 'js-inc' => (array)(Optional) An array of already registered WordPress javascript files to load with the panel.
*
* 'css' => (array)(Optional) An array of css file path (without the extension) to load with this panel.
* File path value is relative to your plugin assets/css directory.
* Ex: test.css file is located under assets/css/test.css then the path value should be 'test'.
*/
namespace atkstarter; //TODO rename to your namespace.
$config['panel']['atkwp'] = ['type' => 'panel',
'page' => 'Hello AtkWp',
'menu' => 'Hello AtkWp',
'slug' => 'atkwp-index',
'uses' => __NAMESPACE__ . '\\panels\\HelloAtkWp',
'capabilities' => 'manage_options',
'position' => null,
'icon' => '',
'js' => [],
'css' => [],
];