-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.php
196 lines (162 loc) · 5.59 KB
/
options.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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?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
$themename = wp_get_theme();
$themename = preg_replace("/\W/", "_", strtolower($themename) );
$optionsframework_settings = get_option( 'optionsframework' );
$optionsframework_settings['id'] = $themename;
update_option( 'optionsframework', $optionsframework_settings );
}
/**
* 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.
*
* If you are making your theme translatable, you should replace 'pepbiz'
* with the actual text domain for your theme. Read more:
* http://codex.wordpress.org/Function_Reference/load_theme_textdomain
*/
function optionsframework_options() {
$options[] = array(
'name' => __('Basic Settings', 'pepbiz'),
'type' => 'heading');
$options[] = array( "name" => __('Custom logo image', 'pepbiz'),
"desc" => __('You can upload custom image for your website logo (optional).', 'pepbiz'),
"id" => "pepbiz_logo_image",
"type" => "upload");
$options[] = array( "name" => __('Phone number', 'pepbiz'),
"id" => "pepbiz_phone",
"desc" => __('Phone number is displayed in the top left corner of the page.', 'pepbiz'),
"type" => "text");
$options[] = array(
'name' => __('Social Networks', 'pepbiz'),
'type' => 'heading');
$options[] = array(
'name' => __('Facebook account', 'pepbiz_theme_options'),
'desc' => __('Enter Facebook account (e.g. pepthemes) or leave empty if you dont wish to use Facebook', 'pepbiz'),
'id' => 'facebook_link',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Twitter account', 'pepbiz_theme_options'),
'desc' => __('Enter Twitter account (e.g. pepthemes) or leave empty if you dont wish to use Twitter', 'pepbiz'),
'id' => 'twitter_link',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Google+ account', 'pepbiz_theme_options'),
'desc' => __('Enter Google+ account (e.g. 12345667890123) or leave empty if you dont wish to use Google+','pepbiz'),
'id' => 'google_link',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('YouTube Account', 'pepbiz_theme_options'),
'desc' => __('Enter YouTube account (e.g. pepthemes) or leave empty if you dont wish to use YouTube','pepbiz'),
'id' => 'youtube_link',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Flickr Account', 'pepbiz_theme_options'),
'desc' => __('Enter url of Flickr account (e.g. pepthemes) or leave empty if you dont wish to use Flickr', 'pepbiz'),
'id' => 'flickr_link',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Slider', 'pepbiz'),
'type' => 'heading');
$options[] = array(
'name' => __('Enable Slider', 'pepbiz'),
'desc' => __('Check this to enable the Slider.', 'pepbiz'),
'id' => 'slider_enabled',
'type' => 'checkbox',
'std' => '0' );
$options[] = array(
'name' => __('Using the Slider', 'pepbiz'),
'desc' => __('This Slider supports upto 5 images. To show only 3 Slides in the slider, upload only 3 images. Leave the rest Blank. For best results, upload images with width more than 960px.', 'pepbiz'),
'type' => 'info');
$options[] = array(
'name' => __('Slide 1', 'pepbiz'),
'desc' => __('First Slide Image', 'pepbiz'),
'id' => 'slide1',
'class' => '',
'type' => 'upload');
$options[] = array(
'desc' => __('Title', 'pepbiz'),
'id' => 'slidetitle1',
'std' => '',
'type' => 'text');
$options[] = array(
'desc' => __('Url Address', 'pepbiz'),
'id' => 'slideurl1',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Slide 2', 'pepbiz'),
'desc' => __('Second Slide Image', 'pepbiz'),
'class' => '',
'id' => 'slide2',
'type' => 'upload');
$options[] = array(
'desc' => __('Title', 'pepbiz'),
'id' => 'slidetitle2',
'std' => '',
'type' => 'text');
$options[] = array(
'desc' => __('Url Address', 'pepbiz'),
'id' => 'slideurl2',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Slide 3', 'pepbiz'),
'desc' => __('Third Slide Image', 'pepbiz'),
'id' => 'slide3',
'class' => '',
'type' => 'upload');
$options[] = array(
'desc' => __('Title', 'pepbiz'),
'id' => 'slidetitle3',
'std' => '',
'type' => 'text');
$options[] = array(
'desc' => __('Url Address', 'pepbiz'),
'id' => 'slideurl3',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Slide 4', 'pepbiz'),
'desc' => __('Fourth Slide Image', 'pepbiz'),
'id' => 'slide4',
'class' => '',
'type' => 'upload');
$options[] = array(
'desc' => __('Title', 'pepbiz'),
'id' => 'slidetitle4',
'std' => '',
'type' => 'text');
$options[] = array(
'desc' => __('Url Address', 'pepbiz'),
'id' => 'slideurl4',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Slide 5', 'pepbiz'),
'desc' => __('Fifth Slide Image', 'pepbiz'),
'id' => 'slide5',
'class' => '',
'type' => 'upload');
$options[] = array(
'desc' => __('Title', 'pepbiz'),
'id' => 'slidetitle5',
'std' => '',
'type' => 'text');
$options[] = array(
'desc' => __('Url Address', 'pepbiz'),
'id' => 'slideurl5',
'std' => '',
'type' => 'text');
return $options;
}