PluginProbe
Ultimate Client Dash / trunk
Ultimate Client Dash vtrunk
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.7.5 1.8 1.8.5 1.9 2.0 2.1 2.2 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 All 35 releases
ulimate-client-dash / admin / settings / widget-settings.php

widget-settings.php in Ultimate Client Dash trunk, at admin/settings/widget-settings.php

361 lines 21.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 // Widget Page Content
5
6 add_action( 'ucd_settings_content', 'ucd_widget_options_page' );
7 function ucd_widget_options_page() {
8 global $ucd_active_tab;
9 if ( 'widget-settings' != $ucd_active_tab )
10 return;
11 ?>
12
13 <h3><?php _e( 'Dashboard Widgets', 'ultimate-client-dash' ); ?></h3>
14
15 <!-- Begin settings form -->
16 <form action="options.php" method="post">
17
18 <?php
19 settings_fields( 'ultimate-client-dash-widget' );
20 do_settings_sections( 'ultimate-client-dash-widget' );
21 $ucd_widget_body = get_option( 'ucd_widget_body' );
22 $ucd_widget_two_body = get_option( 'ucd_widget_two_body' );
23 $ucd_widget_three_body = get_option( 'ucd_widget_three_body' );
24 $ucd_widget_four_body = get_option( 'ucd_widget_four_body' );
25 ?>
26
27 <!-- Dashboard Styling Option Section -->
28
29 <div class="ucd-inner-wrapper settings-widgets">
30 <p class="ucd-settings-desc" style="padding-bottom: 6px;">The dashboard widget option is a great way to customize and declutter the WordPress dashboard homepage. You can choose the row format you would like to display widgets in, and even create your own custom widgets. You can include things like text, links, videos, iframes, and more. These settings apply to all user roles.</p>
31
32 <div class="ucd-form-message"><?php settings_errors('ucd-notices'); ?></div>
33
34 <!-- Table Start -->
35 <table class="form-table">
36 <tbody>
37
38 <div class="ucd-dynamic-item">
39 <div class="ucd-item-name"><?php _e( 'Welcome', 'ultimate-client-dash' ) ?></div>
40 <div class="ucd-item-capabilities">
41 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_welcome" value="#welcome-panel" <?php checked( '#welcome-panel', get_option( 'ucd_widget_welcome' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
42 </div>
43 </div>
44
45 <div class="ucd-dynamic-item">
46 <div class="ucd-item-name"><?php _e( 'Try Glutenberg', 'ultimate-client-dash' ) ?></div>
47 <div class="ucd-item-capabilities">
48 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_glutenberg" value="try_gutenberg_panel" <?php checked( 'try_gutenberg_panel', get_option( 'ucd_widget_glutenberg' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
49 </div>
50 </div>
51
52 <div class="ucd-dynamic-item">
53 <div class="ucd-item-name"><?php _e( 'WordPress Event & News', 'ultimate-client-dash' ) ?></div>
54 <div class="ucd-item-capabilities">
55 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_primary" value="#dashboard_primary" <?php checked( '#dashboard_primary', get_option( 'ucd_widget_primary' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
56 </div>
57 </div>
58
59 <div class="ucd-dynamic-item">
60 <div class="ucd-item-name"><?php _e( 'Other WordPress News', 'ultimate-client-dash' ) ?></div>
61 <div class="ucd-item-capabilities">
62 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_secondary" value="dashboard_secondary" <?php checked( 'dashboard_secondary', get_option( 'ucd_widget_secondary' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
63 </div>
64 </div>
65
66 <div class="ucd-dynamic-item">
67 <div class="ucd-item-name"><?php _e( 'Activity', 'ultimate-client-dash' ) ?></div>
68 <div class="ucd-item-capabilities">
69 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_activity" value="#dashboard_activity" <?php checked( '#dashboard_activity', get_option( 'ucd_widget_activity' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
70 </div>
71 </div>
72
73 <div class="ucd-dynamic-item">
74 <div class="ucd-item-name"><?php _e( 'At A Glance', 'ultimate-client-dash' ) ?></div>
75 <div class="ucd-item-capabilities">
76 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_glance" value="#dashboard_right_now" <?php checked( '#dashboard_right_now', get_option( 'ucd_widget_glance' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
77 </div>
78 </div>
79
80 <div class="ucd-dynamic-item">
81 <div class="ucd-item-name"><?php _e( 'Quick Draft', 'ultimate-client-dash' ) ?></div>
82 <div class="ucd-item-capabilities">
83 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_draft" value="#dashboard_quick_press" <?php checked( '#dashboard_quick_press', get_option( 'ucd_widget_draft' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
84 </div>
85 </div>
86
87 <div class="ucd-dynamic-item">
88 <div class="ucd-item-name"><?php _e( 'Recent Draft', 'ultimate-client-dash' ) ?></div>
89 <div class="ucd-item-capabilities">
90 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_recent_drafts" value="dashboard_recent_drafts" <?php checked( 'dashboard_recent_drafts', get_option( 'ucd_widget_recent_drafts' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
91 </div>
92 </div>
93
94 <div class="ucd-dynamic-item">
95 <div class="ucd-item-name"><?php _e( 'Incoming Links', 'ultimate-client-dash' ) ?></div>
96 <div class="ucd-item-capabilities">
97 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_incoming_links" value="dashboard_incoming_links" <?php checked( 'dashboard_incoming_links', get_option( 'ucd_widget_incoming_links' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
98 </div>
99 </div>
100
101 <div class="ucd-dynamic-item">
102 <div class="ucd-item-name"><?php _e( 'Recent Comments', 'ultimate-client-dash' ) ?></div>
103 <div class="ucd-item-capabilities">
104 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_recent_comments" value="dashboard_recent_comments" <?php checked( 'dashboard_recent_comments', get_option( 'ucd_widget_recent_comments' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
105 </div>
106 </div>
107
108 <div class="ucd-dynamic-item">
109 <div class="ucd-item-name"><?php _e( 'Site Health Status', 'ultimate-client-dash' ) ?></div>
110 <div class="ucd-item-capabilities">
111 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_site_health" value="ucd_widget_site_health" <?php checked( 'ucd_widget_site_health', get_option( 'ucd_widget_site_health' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
112 </div>
113 </div>
114
115 <div class="ucd-dynamic-item">
116 <div class="ucd-item-name"><?php _e( 'PHP Update Required', 'ultimate-client-dash' ) ?></div>
117 <div class="ucd-item-capabilities">
118 <div class="ucd-client"><label class="ucd-switch"><input type="checkbox" name="ucd_widget_php_update" value="ucd_widget_php_update" <?php checked( 'ucd_widget_php_update', get_option( 'ucd_widget_php_update' ) ); ?> /><span class="ucd-slider round"></span></label>Hide</div>
119 </div>
120 </div>
121
122 <tr class="ucd-title-holder" style="margin-top: 24px;">
123 <th><h2 class="ucd-inner-title"><?php _e( 'Custom Widgets', 'ultimate-client-dash' ) ?></h2></th>
124 </tr>
125
126 <tr>
127 <th><?php _e( 'Widget Format', 'ultimate-client-dash' ) ?></th>
128 <td class="ucd-radio-row">
129
130 <input type="radio" name="ucd_widget_rows" value="25%"<?php checked( '25%', get_option( 'ucd_widget_rows' ) ); ?> />4 Rows
131 <input class="ucd-radio-spacing" type="radio" name="ucd_widget_rows" value="50%"<?php checked( '50%', get_option( 'ucd_widget_rows' ) ); ?> />2 Rows
132 <input class="ucd-radio-spacing" type="radio" name="ucd_widget_rows" value="100%"<?php checked( '100%', get_option( 'ucd_widget_rows' ) ); ?> />1 Row
133 <p>Customize the widget row format for the WordPress dashboard. (default 4 rows)</p>
134 </td>
135 </tr>
136
137 <tr class="ucd-pro-version">
138 <th><?php _e( 'Widget Count', 'ultimate-client-dash' ) ?><p>Create up to 4 custom widgets to be displayed on the WordPress dashboard.</p></th>
139 <td><select name="ucd_custom_widget_count">
140 <option value="one" <?php selected(get_option('ucd_custom_widget_count'), "one"); ?>>1</option>
141 <option value="two" <?php selected(get_option('ucd_custom_widget_count'), "two"); ?>>2</option>
142 <option value="three" <?php selected(get_option('ucd_custom_widget_count'), "three"); ?>>3</option>
143 <option value="four" <?php selected(get_option('ucd_custom_widget_count'), "four"); ?>>4</option>
144 </select>
145 <p>
146 Select the number of custom widgets you would like to create. (save changes to update)
147 </p>
148 </td>
149 </tr>
150
151 <?php
152 $ucd_widget_count = get_option('ucd_custom_widget_count');
153 if ($ucd_widget_count == "one" || "two" || "three" || "four") {
154 ?>
155
156 <tr class="ucd-title-holder">
157 <th><h2 class="ucd-inner-title"><?php _e( 'Widget - ', 'ultimate-client-dash' ) ?><?php echo esc_attr( get_option('ucd_widget_title') ); ?></h2></th>
158 </tr>
159
160 <tr>
161 <th><?php _e( 'Widget - ', 'ultimate-client-dash' ) ?><?php echo esc_attr( get_option('ucd_widget_title') ); ?></th>
162 <td><label class="ucd-switch"><input type="checkbox" name="ucd_custom_widget" value="#brand_dash_widget" <?php checked( '#brand_dash_widget', get_option( 'ucd_custom_widget' ) ); ?> /><span class="ucd-slider round"></span></label>Enable
163 <p>
164 Enable to activate widget.
165 </p>
166 </td>
167 </tr>
168
169 <tr>
170 <th><?php _e( 'Title', 'ultimate-client-dash' ) ?></th>
171 <td><input type="text" placeholder="" name="ucd_widget_title" value="<?php echo esc_attr( get_option('ucd_widget_title') ); ?>" size="70" /></td>
172 </tr>
173
174 <tr>
175 <th><?php _e( 'Shortcode', 'ultimate-client-dash' ) ?><p>Displays below content.</p></th>
176 <td><input type="text" placeholder="" name="ucd_custom_widget_shortcode" value="<?php echo esc_attr( get_option('ucd_custom_widget_shortcode') ); ?>" size="70" />
177 <p>If you would like to use a shortcode with your custom widget you can add it here.</p>
178 </td>
179 </tr>
180
181 <tr>
182 <th><?php _e( 'Content', 'ultimate-client-dash' ) ?>
183 <p>Customize the widget by using the content editor to add your own text. HTML markup can be used.</p>
184 </th>
185
186 <td class="ucd-custom-content">
187 <?php
188 wp_editor( $ucd_widget_body , 'ucd_widget_body', array(
189 'wpautop' => false,
190 'media_buttons' => true,
191 'textarea_name' => 'ucd_widget_body',
192 'editor_class' => 'my_custom_class',
193 'textarea_rows' => 15
194 ) );
195 ?>
196 </td>
197 </tr>
198
199 <?php } ?>
200 <?php
201 $ucd_widget_count = get_option('ucd_custom_widget_count');
202 if ($ucd_widget_count !== "one") {
203 ?>
204
205 <tr class="ucd-title-holder">
206 <th><h2 class="ucd-inner-title"><?php _e( 'Widget - ', 'ultimate-client-dash' ) ?><?php echo esc_attr( get_option('ucd_widget_two_title') ); ?></h2></th>
207 </tr>
208
209 <tr>
210 <th><?php _e( 'Widget - ', 'ultimate-client-dash' ) ?><?php echo esc_attr( get_option('ucd_widget_two_title') ); ?></th>
211 <td><label class="ucd-switch"><input type="checkbox" name="ucd_custom_widget_two" value="#brand_dash_widget" <?php checked( '#brand_dash_widget', get_option( 'ucd_custom_widget_two' ) ); ?> /><span class="ucd-slider round"></span></label>Enable
212 <p>
213 Enable to activate widget.
214 </p>
215 </td>
216 </tr>
217
218 <tr>
219 <th><?php _e( 'Title', 'ultimate-client-dash' ) ?></th>
220 <td><input type="text" placeholder="" name="ucd_widget_two_title" value="<?php echo esc_attr( get_option('ucd_widget_two_title') ); ?>" size="70" /></td>
221 </tr>
222
223 <tr>
224 <th><?php _e( 'Shortcode', 'ultimate-client-dash' ) ?><p>Displays below content.</p></th>
225 <td><input type="text" placeholder="" name="ucd_custom_widget_two_shortcode" value="<?php echo esc_attr( get_option('ucd_custom_widget_two_shortcode') ); ?>" size="70" />
226 <p>If you would like to use a shortcode with your custom widget you can add it here.</p>
227 </td>
228 </tr>
229
230 <tr>
231 <th><?php _e( 'Content', 'ultimate-client-dash' ) ?>
232 <p>Customize the widget by using the content editor to add your own text. HTML markup can be used.</p>
233 </th>
234
235 <td class="ucd-custom-content">
236 <?php
237 wp_editor( $ucd_widget_two_body , 'ucd_widget_two_body', array(
238 'wpautop' => false,
239 'media_buttons' => true,
240 'textarea_name' => 'ucd_widget_two_body',
241 'editor_class' => 'my_custom_class',
242 'textarea_rows' => 15
243 ) );
244 ?>
245 </td>
246 </tr>
247
248 <?php }?>
249 <?php
250 $ucd_widget_count = get_option('ucd_custom_widget_count');
251 if ($ucd_widget_count == "three" || "four" && $ucd_widget_count !== "two" && $ucd_widget_count !== "one") {
252 ?>
253
254 <tr class="ucd-title-holder">
255 <th><h2 class="ucd-inner-title"><?php _e( 'Widget - ', 'ultimate-client-dash' ) ?><?php echo esc_attr( get_option('ucd_widget_three_title') ); ?></h2></th>
256 </tr>
257
258 <tr>
259 <th><?php _e( 'Widget - ', 'ultimate-client-dash' ) ?><?php echo esc_attr( get_option('ucd_widget_two_title') ); ?></th>
260 <td><label class="ucd-switch"><input type="checkbox" name="ucd_custom_widget_three" value="#brand_dash_widget" <?php checked( '#brand_dash_widget', get_option( 'ucd_custom_widget_three' ) ); ?> /><span class="ucd-slider round"></span></label>Enable
261 <p>
262 Enable to activate widget.
263 </p>
264 </td>
265 </tr>
266
267 <tr>
268 <th><?php _e( 'Title', 'ultimate-client-dash' ) ?></th>
269 <td><input type="text" placeholder="" name="ucd_widget_three_title" value="<?php echo esc_attr( get_option('ucd_widget_three_title') ); ?>" size="70" /></td>
270 </tr>
271
272 <tr>
273 <th><?php _e( 'Shortcode', 'ultimate-client-dash' ) ?><p>Displays below content.</p></th>
274 <td><input type="text" placeholder="" name="ucd_custom_widget_three_shortcode" value="<?php echo esc_attr( get_option('ucd_custom_widget_three_shortcode') ); ?>" size="70" />
275 <p>If you would like to use a shortcode with your custom widget you can add it here.</p>
276 </td>
277 </tr>
278
279 <tr>
280 <th><?php _e( 'Content', 'ultimate-client-dash' ) ?>
281 <p>Customize the widget by using the content editor to add your own text. HTML markup can be used.</p>
282 </th>
283
284 <td class="ucd-custom-content">
285 <?php
286 wp_editor( $ucd_widget_three_body , 'ucd_widget_three_body', array(
287 'wpautop' => false,
288 'media_buttons' => true,
289 'textarea_name' => 'ucd_widget_three_body',
290 'editor_class' => 'my_custom_class',
291 'textarea_rows' => 15
292 ) );
293 ?>
294 </td>
295 </tr>
296
297 <?php } ?>
298 <?php
299 $ucd_widget_count = get_option('ucd_custom_widget_count');
300 if ($ucd_widget_count == "four") {
301 ?>
302
303 <tr class="ucd-title-holder">
304 <th><h2 class="ucd-inner-title"><?php _e( 'Widget - ', 'ultimate-client-dash' ) ?><?php echo esc_attr( get_option('ucd_widget_four_title') ); ?></h2></th>
305 </tr>
306
307 <tr>
308 <th><?php _e( 'Widget - ', 'ultimate-client-dash' ) ?><?php echo esc_attr( get_option('ucd_widget_two_title') ); ?></th>
309 <td><label class="ucd-switch"><input type="checkbox" name="ucd_custom_widget_four" value="#brand_dash_widget" <?php checked( '#brand_dash_widget', get_option( 'ucd_custom_widget_four' ) ); ?> /><span class="ucd-slider round"></span></label>Enable
310 <p>
311 Enable to activate widget.
312 </p>
313 </td>
314 </tr>
315
316 <tr>
317 <th><?php _e( 'Title', 'ultimate-client-dash' ) ?></th>
318 <td><input type="text" placeholder="" name="ucd_widget_four_title" value="<?php echo esc_attr( get_option('ucd_widget_four_title') ); ?>" size="70" /></td>
319 </tr>
320
321 <tr>
322 <th><?php _e( 'Shortcode', 'ultimate-client-dash' ) ?><p>Displays below content.</p></th>
323 <td><input type="text" placeholder="" name="ucd_custom_widget_four_shortcode" value="<?php echo esc_attr( get_option('ucd_custom_widget_four_shortcode') ); ?>" size="70" />
324 <p>If you would like to use a shortcode with your custom widget you can add it here.</p>
325 </td>
326 </tr>
327
328 <tr>
329 <th><?php _e( 'Content', 'ultimate-client-dash' ) ?>
330 <p>Customize the widget by using the content editor to add your own text. HTML markup can be used.</p>
331 </th>
332
333 <td class="ucd-custom-content">
334 <?php
335 wp_editor( $ucd_widget_four_body , 'ucd_widget_four_body', array(
336 'wpautop' => false,
337 'media_buttons' => true,
338 'textarea_name' => 'ucd_widget_four_body',
339 'editor_class' => 'my_custom_class',
340 'textarea_rows' => 15
341 ) );
342 ?>
343 </td>
344 </tr>
345
346 <?php } ?>
347
348 <tr class="ucd-float-option">
349 <th class="ucd-save-section">
350 <?php submit_button(); ?>
351 </th>
352 </tr>
353
354 </tbody>
355 </table>
356 </div>
357
358 </form>
359 <?php }
360
361