-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.php
More file actions
152 lines (125 loc) · 4 KB
/
options.php
File metadata and controls
152 lines (125 loc) · 4 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
* If the identifier changes, it'll appear as if the options have been reset.
*
*/
function optionsframework_option_name() {
// This gets the theme name from the stylesheet (lowercase and without spaces)
$themename = get_option('stylesheet');
$themename = preg_replace("/\W/", "_", strtolower($themename));
$optionsframework_settings = get_option('optionsframework');
$optionsframework_settings['id'] = $themename;
update_option('optionsframework', $optionsframework_settings);
// echo $themename;
}
/**
* Defines an array of options that will be used to generate the settings page and be saved in the database.
* When creating the 'id' fields, make sure to use all lowercase and no spaces.
*
*/
function optionsframework_options()
{
$default_options = convert_default_options();
$options = array();
$options[] = array(
'name' => __("Basic Settings", 'convert'),
'type' => 'heading'
);
$options[] = array(
'name' => __("Business Name", 'convert'),
'id' => 'business_name',
'type' => 'text'
);
$options[] = array(
'name' => __("Logo", 'convert'),
'desc' => __("We recommend an image that is 370px by 96px", 'convert'),
'id' => 'logo',
'type' => 'upload'
);
$options[] = array(
'name' => __("Hero Cover", 'convert'),
'id' => 'hero_cover',
'type' => 'upload'
);
$options[] = array(
'name' => __("Phone Number", 'convert'),
'id' => 'tel',
'type' => 'text'
);
$options[] = array(
'name' => __("Front Page Hero", 'convert'),
'id' => 'front_page_hero',
'type' => 'editor'
);
$options[] = array(
'name' => __("Social Media Settings", 'convert'),
'type' => 'heading'
);
$options[] = array(
'name' => __("Twitter", 'convert'),
'id' => 'twitter_url',
'type' => 'text'
);
$options[] = array(
'name' => __("Facebook", 'convert'),
'id' => 'facebook_url',
'type' => 'text'
);
$options[] = array(
'name' => __("Font Settings", 'convert'),
'type' => 'heading'
);
$options[] = array(
'name' => __("Base Font Family", 'convert'),
'id' => 'base_font_family',
'type' => 'text'
);
$options[] = array(
'name' => __("Heading Font Family", 'convert'),
'id' => 'heading_font_family',
'type' => 'text'
);
$options[] = array(
'name' => __("Color Settings", 'convert'),
'type' => 'heading'
);
$options[] = array(
'name' => __("Primary Color", 'convert'),
'id' => 'primary_color',
'type' => 'color',
'std' => $default_options['primary_color']
);
$options[] = array(
'name' => __("Complimentary Color", 'convert'),
'id' => 'complimentary_color',
'type' => 'color',
'std' => $default_options['complimentary_color']
);
$options[] = array(
'name' => __("Contrast Color", 'convert'),
'id' => 'contrast_color',
'type' => 'color',
'std' => $default_options['contrast_color']
);
$options[] = array(
'name' => __("Text Color", 'convert'),
'id' => 'text_color',
'type' => 'color',
'std' => $default_options['text_color']
);
$options[] = array(
'name' => __("Headings Color", 'convert'),
'id' => 'headings_color',
'type' => 'color',
'std' => $default_options['headings_color']
);
$options[] = array(
'name' => __("Contrast Text Color", 'convert'),
'id' => 'contrast_text_color',
'type' => 'color',
'std' => $default_options['contrast_text_color']
);
return $options;
}