-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.php
More file actions
218 lines (184 loc) · 7.14 KB
/
options.php
File metadata and controls
218 lines (184 loc) · 7.14 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
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?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 = get_option( 'stylesheet' );
$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 'quark'
* with the actual text domain for your theme. Read more:
* http://codex.wordpress.org/Function_Reference/load_theme_textdomain
*/
function optionsframework_options() {
// If using image radio buttons, define a directory path
$imagepath = trailingslashit( get_template_directory_uri() ) . 'images/';
// Background Defaults
$background_defaults = array(
'color' => '#222222',
'image' => $imagepath . 'dark-noise.jpg',
'repeat' => 'repeat',
'position' => 'top left',
'attachment'=>'scroll' );
// Editor settings
$wp_editor_settings = array(
'wpautop' => true, // Default
'textarea_rows' => 5,
'tinymce' => array( 'plugins' => 'wordpress' )
);
// Footer Position settings
$footer_position_settings = array(
'left' => esc_html__( 'Left aligned', 'quark' ),
'center' => esc_html__( 'Center aligned', 'quark' ),
'right' => esc_html__( 'Right aligned', 'quark' )
);
$options = array();
$options[] = array(
'name' => esc_html__( 'Basic Settings', 'quark' ),
'type' => 'heading' );
$options[] = array(
'name' => esc_html__( 'Background', 'quark' ),
'desc' => sprintf( wp_kses( __( 'If you’d like to replace or remove the default background image, use the <a href="%1$s" title="Custom background">Appearance > Background</a> menu option.', 'quark' ), array(
'a' => array(
'href' => array(),
'title' => array() )
) ), admin_url( 'themes.php?page=custom-background' ) ),
'type' => 'info' );
$options[] = array(
'name' => esc_html__( 'Logo', 'quark' ),
'desc' => sprintf( wp_kses( __( 'If you’d like to replace or remove the default logo, use the <a href="%1$s" title="Custom header">Appearance > Header</a> menu option.', 'quark' ), array(
'a' => array(
'href' => array(),
'title' => array() )
) ), admin_url( 'themes.php?page=custom-header' ) ),
'type' => 'info' );
$options[] = array(
'name' => esc_html__( 'Social Media Settings', 'quark' ),
'desc' => esc_html__( 'Enter the URLs for your Social Media platforms. You can also optionally specify whether you want these links opened in a new browser tab/window.', 'quark' ),
'type' => 'info' );
$options[] = array(
'name' => esc_html__('Open links in new Window/Tab', 'quark'),
'desc' => esc_html__('Open the social media links in a new browser tab/window', 'quark'),
'id' => 'social_newtab',
'std' => '0',
'type' => 'checkbox');
$options[] = array(
'name' => esc_html__( 'Twitter', 'quark' ),
'desc' => esc_html__( 'Enter your Twitter URL.', 'quark' ),
'id' => 'social_twitter',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Facebook', 'quark' ),
'desc' => esc_html__( 'Enter your Facebook URL.', 'quark' ),
'id' => 'social_facebook',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Google+', 'quark' ),
'desc' => esc_html__( 'Enter your Google+ URL.', 'quark' ),
'id' => 'social_googleplus',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'LinkedIn', 'quark' ),
'desc' => esc_html__( 'Enter your LinkedIn URL.', 'quark' ),
'id' => 'social_linkedin',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Dribbble', 'quark' ),
'desc' => esc_html__( 'Enter your Dribbble URL.', 'quark' ),
'id' => 'social_dribbble',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Tumblr', 'quark' ),
'desc' => esc_html__( 'Enter your Tumblr URL.', 'quark' ),
'id' => 'social_tumblr',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'GitHub', 'quark' ),
'desc' => esc_html__( 'Enter your GitHub URL.', 'quark' ),
'id' => 'social_github',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Bitbucket', 'quark' ),
'desc' => esc_html__( 'Enter your Bitbucket URL.', 'quark' ),
'id' => 'social_bitbucket',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Foursquare', 'quark' ),
'desc' => esc_html__( 'Enter your Foursquare URL.', 'quark' ),
'id' => 'social_foursquare',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'YouTube', 'quark' ),
'desc' => esc_html__( 'Enter your YouTube URL.', 'quark' ),
'id' => 'social_youtube',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Instagram', 'quark' ),
'desc' => esc_html__( 'Enter your Instagram URL.', 'quark' ),
'id' => 'social_instagram',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Flickr', 'quark' ),
'desc' => esc_html__( 'Enter your Flickr URL.', 'quark' ),
'id' => 'social_flickr',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Pinterest', 'quark' ),
'desc' => esc_html__( 'Enter your Pinterest URL.', 'quark' ),
'id' => 'social_pinterest',
'std' => '',
'type' => 'text' );
$options[] = array(
'name' => esc_html__( 'Advanced settings', 'quark' ),
'type' => 'heading' );
$options[] = array(
'name' => esc_html__( 'Banner Background', 'quark' ),
'desc' => esc_html__( 'Select an image and background color for the homepage banner.', 'quark' ),
'id' => 'banner_background',
'std' => $background_defaults,
'type' => 'background' );
$options[] = array(
'name' => esc_html__( 'Footer Background Color', 'quark' ),
'desc' => esc_html__( 'Select the background color for the footer.', 'quark' ),
'id' => 'footer_color',
'std' => '#222222',
'type' => 'color' );
$options[] = array(
'name' => esc_html__( 'Footer Content', 'quark' ),
'desc' => esc_html__( 'Enter the text you‘d like to display in the footer. This content will be displayed just below the footer widgets. It‘s ideal for displaying your copyright message or credits.', 'quark' ),
'id' => 'footer_content',
'std' => quark_get_credits(),
'type' => 'editor',
'settings' => $wp_editor_settings );
$options[] = array(
'name' => esc_html__( 'Footer Content Position', 'quark' ),
'desc' => esc_html__( 'Select what position you would like the footer content aligned to.', 'quark' ),
'id' => 'footer_position',
'std' => 'center',
'type' => 'select',
'class' => 'mini',
'options' => $footer_position_settings );
return $options;
}