-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathgust-options-data.php
More file actions
59 lines (59 loc) · 1.56 KB
/
gust-options-data.php
File metadata and controls
59 lines (59 loc) · 1.56 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
<?php
class Gust_Options_Data {
public static function list_post_types(){
$post_types = get_post_types(array('show_ui'=>true),'objects');
$result = array();
foreach ($post_types as $name=>$post_type) :
if ($name != 'attachment') :
// print_r($post_type);
$result[$name] = $post_type->label;
endif;
endforeach;
return $result;
}
public static function get() {
return array(
'page_title' => __( 'Gust Options', 'gust' ),
'page_description' => false,
'menu_title' => __( 'Gust', 'gust' ),
'permission' => 'manage_options',
'menu_slug' => 'gust_options',
'option_name' => 'gust_options',
'plugin_path' => 'gust_options',
'defaults' => array(
'main_endpoint' => 'gust',
'main_posttypes' => array(
'post' => true,
'page' => true
),
'main_dateformat' => 'YYYY MMM DD hh:mm',
),
'section' => array(
array(
'slug' => 'main',
'title' => __( 'Main Settings', 'gust' ),
'field' => array(
array(
'slug' => 'endpoint',
'title' => __( 'URL endpoint', 'gust' ),
'type' => 'text'
),
array(
'slug' => 'dateformat',
'title' => __( 'Date format', 'gust' ),
'type' => 'text'
),
array(
'slug' => 'posttypes',
'title' => __( 'Use Gust for', 'gust' ),
'type' => 'checkbox_list',
'options' => array(
'list' => self::list_post_types()
),
),
),
),
),
);
}
}