-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.php
60 lines (43 loc) · 1.13 KB
/
test.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
<?php
/*
* Plugin Name: ZeroWp AdminPage Test
*/
require_once dirname(__FILE__) . "/ZeroWP/AdminPage/mod.php";
require_once dirname(__FILE__) . "/ZeroWP/Form/mod.php";
class ExamplePage extends ZeroWP\Admin\Page{
public function settings(){
return array(
'parent_slug' => 'options-general.php',
'menu_title' => __('Example page', 'text-domain'),
);
}
public function page(){
echo 'Page content here!';
}
}
$example_page = new ExamplePage('page-slug');
$example_page->init(); //Initialize this page.
class ExampleTab extends ZeroWP\Admin\Tab{
public function settings(){
return array(
'label' => __('Tab title', 'text-domain')
);
}
public function page(){
$form = new ZeroWP\AdminForm\Create;
$form->openForm();
$form->addField( 'fieldid1', 'input', 19, array(
'label' => 'Input test',
'size' => 'small',
'type_attr' => 'number',
'text_before' => 'Mark is',
'text_after' => 'years old',
) );
$form->addField( 'fieldid2', 'textarea', 'the value', array(
'label' => 'Textarea test',
) );
$form->addSubmitButton();
$form->closeForm();
}
}
new ExampleTab('tabid', 'page-slug');