PluginProbe
All-in-one Sticky Floating Contact Form, Call, Click to Chat, and 50+ Social Icon Tabs – My Sticky Elements / trunk
All-in-one Sticky Floating Contact Form, Call, Click to Chat, and 50+ Social Icon Tabs – My Sticky Elements vtrunk
2.3.9 2.3.8 2.3.7 2.3.6 2.3.5 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 All 99 releases
mystickyelements / mystickyelements.php

mystickyelements.php in All-in-one Sticky Floating Contact Form, Call, Click to Chat, and 50+ Social Icon Tabs – My Sticky Elements trunk, at mystickyelements.php

3,988 lines 190.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: My Sticky Elements
4 Plugin URI: https://premio.io/
5 Description: My Sticky Elements is simple yet very effective plugin. It is perfect to fill out usually unused side space on webpages with some additional messages, videos, social widgets ...
6 Version: 2.3.9
7 Author: Premio
8 Author URI: https://premio.io/
9 Domain Path: /languages
10 License: GPLv3
11 */
12
13 defined('ABSPATH') or die("Cannot access pages directly.");
14
15 define('MYSTICKYELEMENTS_URL', plugins_url('/', __FILE__)); // Define Plugin URL
16 define('MYSTICKYELEMENTS_PATH', plugin_dir_path(__FILE__)); // Define Plugin Directory Path
17 define('MYSTICKYELEMENTS_BASE', plugin_basename(__FILE__));
18 define("MY_STICKY_ELEMENT_VERSION", "2.3.9");
19
20 /*
21 * redirect my sticky element setting page after plugin activated
22 */
23 add_action('activated_plugin', 'mystickyelement_activation_redirect');
24 function mystickyelement_activation_redirect($plugin)
25 {
26
27 if ($plugin == plugin_basename(__FILE__)) {
28
29 if (!defined('DOING_AJAX')) {
30 add_option("mse_redirect", 1);
31 }
32 }
33 }
34
35 if (!function_exists("check_for_mse_redirect")) {
36 function check_for_mse_redirect()
37 {
38 if (!defined("DOING_AJAX")) {
39 if (get_option("mse_redirect")) {
40 delete_option("mse_redirect");
41 $mystickyelements_contact_form = get_option("mystickyelements-contact-form");
42 $mystickyelements_widgets = get_option("mystickyelements-widgets");
43 if ($mystickyelements_widgets && $mystickyelements_contact_form) {
44 wp_redirect(admin_url('admin.php?page=my-sticky-elements'));
45 } else {
46 wp_redirect(admin_url('admin.php?page=my-sticky-elements&widget=0'));
47 }
48 exit;
49 }
50 }
51 }
52
53 add_action("admin_init", "check_for_mse_redirect");
54 }
55
56
57 class MyStickyElementsPage
58 {
59 private $options;
60 private $options0;
61 private $options1;
62 private $options2;
63 private $options3;
64 private $options4;
65 private $options5;
66 private $options6;
67 private $options7;
68 private $options8;
69 private $options9;
70 public function __construct()
71 {
72 add_action('admin_menu', array( $this, 'add_plugin_page' ));
73 add_action('admin_init', array( $this, 'page_init' ));
74 add_action('admin_init', array( $this, 'mystickysideelement_load_transl'));
75 add_action('admin_enqueue_scripts', array( $this, 'mw_enqueue_color_picker' ));
76
77 }
78
79 public function mystickysideelement_load_transl()
80 {
81 load_plugin_textdomain('mystickyelements', false, dirname(plugin_basename(__FILE__)).'/languages/');
82 }
83
84 public function add_plugin_page()
85 {
86 add_options_page(
87 'Settings Admin',
88 'myStickyelements',
89 'manage_options',
90 'my-sticky-elements-settings',
91 array( $this, 'create_admin_page' )
92 );
93 }
94
95 public function create_admin_page()
96 {
97
98
99 // Set class property
100 // $all_options = array (
101 $this->options = get_option('mysticky_elements_options');
102 $this->options0 = get_option('mysticky_elements_options0');
103 $this->options1 = get_option('mysticky_elements_options1');
104 $this->options2 = get_option('mysticky_elements_options2');
105 $this->options3 = get_option('mysticky_elements_options3');
106 $this->options4 = get_option('mysticky_elements_options4');
107 $this->options5 = get_option('mysticky_elements_options5');
108 $this->options6 = get_option('mysticky_elements_options6');
109 $this->options7 = get_option('mysticky_elements_options7');
110 $this->options8 = get_option('mysticky_elements_options8');
111 $this->options9 = get_option('mysticky_elements_options9');
112 ?>
113 <div class="wrap">
114 <?php screen_icon(); ?>
115 <h2><?php _e('myStickylements Settings', 'mystickyelements'); ?></h2>
116
117 <?php $active_tab = isset($_GET[ 'tab' ]) ? $_GET[ 'tab' ] : 'general'; ?>
118
119 <h2 class="nav-tab-wrapper">
120 <a href="?page=my-sticky-elements-settings&tab=general" class="nav-tab <?php echo esc_attr($active_tab == 'general' ? 'nav-tab-active' : ''); ?>">General Settings</a>
121 <a href="?page=my-sticky-elements-settings&tab=element_1" class="nav-tab <?php echo esc_attr($active_tab == 'element_1' ? 'nav-tab-active' : ''); ?>">E1</a>
122 <a href="?page=my-sticky-elements-settings&tab=element_2" class="nav-tab <?php echo esc_attr($active_tab == 'element_2' ? 'nav-tab-active' : ''); ?>">E2</a>
123 <a href="?page=my-sticky-elements-settings&tab=element_3" class="nav-tab <?php echo esc_attr($active_tab == 'element_3' ? 'nav-tab-active' : ''); ?>">E3</a>
124 <a href="?page=my-sticky-elements-settings&tab=element_4" class="nav-tab <?php echo esc_attr($active_tab == 'element_4' ? 'nav-tab-active' : ''); ?>">E4</a>
125 <a href="?page=my-sticky-elements-settings&tab=element_5" class="nav-tab <?php echo esc_attr($active_tab == 'element_5' ? 'nav-tab-active' : ''); ?>">E5</a>
126 <a href="?page=my-sticky-elements-settings&tab=element_6" class="nav-tab <?php echo esc_attr($active_tab == 'element_6' ? 'nav-tab-active' : ''); ?>">E6</a>
127 <a href="?page=my-sticky-elements-settings&tab=element_7" class="nav-tab <?php echo esc_attr($active_tab == 'element_7' ? 'nav-tab-active' : ''); ?>">E7</a>
128 <a href="?page=my-sticky-elements-settings&tab=element_8" class="nav-tab <?php echo esc_attr($active_tab == 'element_8' ? 'nav-tab-active' : ''); ?>">E8</a>
129 <a href="?page=my-sticky-elements-settings&tab=element_9" class="nav-tab <?php echo esc_attr($active_tab == 'element_9' ? 'nav-tab-active' : ''); ?>">E9</a>
130 <a href="?page=my-sticky-elements-settings&tab=element_10" class="nav-tab <?php echo esc_attr($active_tab == 'element_10' ? 'nav-tab-active' : ''); ?>">E10</a>
131 </h2>
132 <form method="post" action="options.php">
133 <?php
134
135 if ($active_tab == 'general') {
136
137 settings_fields('mysticky_elements_option_group');
138 do_settings_sections('my-sticky-elements-settings');
139
140 } elseif ($active_tab == 'element_1') {
141
142 settings_fields('mysticky_elements_option_group9');
143 do_settings_sections('my-sticky-elements-settings9');
144
145
146 } elseif ($active_tab == 'element_2') {
147
148 settings_fields('mysticky_elements_option_group8');
149 do_settings_sections('my-sticky-elements-settings8');
150
151 } elseif ($active_tab == 'element_3') {
152
153 settings_fields('mysticky_elements_option_group7');
154 do_settings_sections('my-sticky-elements-settings7');
155
156 } elseif ($active_tab == 'element_4') {
157
158 settings_fields('mysticky_elements_option_group6');
159 do_settings_sections('my-sticky-elements-settings6');
160
161 } elseif ($active_tab == 'element_5') {
162
163 settings_fields('mysticky_elements_option_group5');
164 do_settings_sections('my-sticky-elements-settings5');
165
166 } elseif ($active_tab == 'element_6') {
167
168 settings_fields('mysticky_elements_option_group4');
169 do_settings_sections('my-sticky-elements-settings4');
170
171 } elseif ($active_tab == 'element_7') {
172
173 settings_fields('mysticky_elements_option_group3');
174 do_settings_sections('my-sticky-elements-settings3');
175
176 } elseif ($active_tab == 'element_8') {
177
178 settings_fields('mysticky_elements_option_group2');
179 do_settings_sections('my-sticky-elements-settings2');
180
181 } elseif ($active_tab == 'element_9') {
182
183 settings_fields('mysticky_elements_option_group1');
184 do_settings_sections('my-sticky-elements-settings1');
185
186 } elseif ($active_tab == 'element_10') {
187
188 settings_fields('mysticky_elements_option_group0');
189 do_settings_sections('my-sticky-elements-settings0');
190
191 }
192
193 // This prints out all hidden setting fields
194 // settings_fields( 'mysticky_elements_option_group' );
195 // do_settings_sections( 'my-sticky-elements-settings' );
196 submit_button();
197 ?>
198 </form>
199 </div>
200 <?php
201 }
202
203 /**
204 * Register and add settings
205 */
206 public function page_init()
207 {
208 global $id, $title, $callback, $page;
209 register_setting(
210 'mysticky_elements_option_group', // Option group
211 'mysticky_elements_options', // Option name
212 array( $this, 'sanitize' ) // Sanitize
213 );
214 register_setting(
215 'mysticky_elements_option_group9',
216 'mysticky_elements_options9',
217 array( $this, 'sanitize' )
218 );
219
220 register_setting(
221 'mysticky_elements_option_group8',
222 'mysticky_elements_options8',
223 array( $this, 'sanitize' )
224 );
225 register_setting(
226 'mysticky_elements_option_group7',
227 'mysticky_elements_options7',
228 array( $this, 'sanitize' )
229 );
230 register_setting(
231 'mysticky_elements_option_group6',
232 'mysticky_elements_options6',
233 array( $this, 'sanitize' )
234 );
235 register_setting(
236 'mysticky_elements_option_group5',
237 'mysticky_elements_options5',
238 array( $this, 'sanitize' )
239 );
240 register_setting(
241 'mysticky_elements_option_group4',
242 'mysticky_elements_options4',
243 array( $this, 'sanitize' )
244 );
245 register_setting(
246 'mysticky_elements_option_group3',
247 'mysticky_elements_options3',
248 array( $this, 'sanitize' )
249 );
250 register_setting(
251 'mysticky_elements_option_group2',
252 'mysticky_elements_options2',
253 array( $this, 'sanitize' )
254 );
255 register_setting(
256 'mysticky_elements_option_group1',
257 'mysticky_elements_options1',
258 array( $this, 'sanitize' )
259 );
260 register_setting(
261 'mysticky_elements_option_group0',
262 'mysticky_elements_options0',
263 array( $this, 'sanitize' )
264 );
265
266 add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array());
267
268 //** General Settings **//
269 add_settings_section(
270 'setting_section_id', // ID
271 esc_html__("myStickyElements Options", 'mystickyelements'), // Title
272 array( $this, 'print_section_info' ), // Callback
273 'my-sticky-elements-settings' // Page
274 );
275
276 add_settings_field(
277 'myfixed_disable_small_screen',
278 esc_html__("Disable at Small Screen Sizes", 'mystickyelements'),
279 array( $this, 'myfixed_disable_small_screen_callback' ),
280 'my-sticky-elements-settings',
281 'setting_section_id'
282 );
283
284 /* add_settings_field(
285 'mysticky_active_on_height',
286 'Make visible when scroled',
287 array( $this, 'mysticky_active_on_height_callback' ),
288 'my-sticky-elements-settings',
289 'setting_section_id'
290 );*/
291
292 add_settings_field(
293 'myfixed_click',
294 esc_html__("Change on Event", 'mystickyelements'),
295 array( $this, 'myfixed_click_callback' ),
296 'my-sticky-elements-settings',
297 'setting_section_id'
298 );
299
300 add_settings_field(
301 'myfixed_cssstyle',
302 esc_html__("CSS style", 'mystickyelements'),
303 array( $this, 'myfixed_cssstyle_callback' ),
304 'my-sticky-elements-settings',
305 'setting_section_id'
306 );
307
308
309 //** First element 9 **//
310
311 add_settings_section(
312 'setting_section_id', // ID
313 esc_html__("myStickyElements Options", 'mystickyelements'), // Title
314 array( $this, 'print_section_info9' ), // Callback
315 'my-sticky-elements-settings9' // Page
316 );
317 add_settings_field(
318 'myfixed_element_enable',
319 esc_html__("Enable Element", 'mystickyelements'),
320 array( $this, 'myfixed_element9_enable_callback' ),
321 'my-sticky-elements-settings9',
322 'setting_section_id'
323 );
324 add_settings_field(
325 'myfixed_element_side_position',
326 esc_html__("Horizontal Position", 'mystickyelements'),
327 array( $this, 'myfixed_element9_side_position_callback' ),
328 'my-sticky-elements-settings9',
329 'setting_section_id'
330 );
331 add_settings_field(
332 'myfixed_element_top_position',
333 esc_html__("Vertical Position", 'mystickyelements'),
334 array( $this, 'myfixed_element9_top_position_callback' ),
335 'my-sticky-elements-settings9',
336 'setting_section_id'
337 );
338 add_settings_field(
339 'myfixed_element_icon_bg_color',
340 esc_html__("Icon bg Color", 'mystickyelements'),
341 array( $this, 'myfixed_element9_icon_bg_color_callback' ),
342 'my-sticky-elements-settings9',
343 'setting_section_id'
344 );
345 add_settings_field(
346 'myfixed_element_icon_bg_img',
347 esc_html__("Icon bg Image", 'mystickyelements'),
348 array( $this, 'myfixed_element9_icon_bg_img_callback' ),
349 'my-sticky-elements-settings9',
350 'setting_section_id'
351 );
352 add_settings_field(
353 'myfixed_element_content_bg_color',
354 esc_html__("Content bg Color", 'mystickyelements'),
355 array( $this, 'myfixed_element9_content_bg_color_callback' ),
356 'my-sticky-elements-settings9',
357 'setting_section_id'
358 );
359 add_settings_field(
360 'myfixed_element_content_txt_color',
361 esc_html__("Content Text Color", 'mystickyelements'),
362 array( $this, 'myfixed_element9_content_txt_color_callback' ),
363 'my-sticky-elements-settings9',
364 'setting_section_id'
365 );
366 add_settings_field(
367 'myfixed_element_content_width',
368 esc_html__("Content Width", 'mystickyelements'),
369 array( $this, 'myfixed_element9_content_width_callback' ),
370 'my-sticky-elements-settings9',
371 'setting_section_id'
372 );
373 add_settings_field(
374 'myfixed_element_content_padding',
375 esc_html__("Content Padding", 'mystickyelements'),
376 array( $this, 'myfixed_element9_content_padding_callback' ),
377 'my-sticky-elements-settings9',
378 'setting_section_id'
379 );
380 add_settings_field(
381 'myfixed_element_content',
382 esc_html__("Content", 'mystickyelements'),
383 array( $this, 'myfixed_element9_content_callback' ),
384 'my-sticky-elements-settings9',
385 'setting_section_id'
386 );
387
388
389 //** Second element 8 **//
390 add_settings_section(
391 'setting_section_id',
392 esc_html__("myStickyElements Options", 'mystickyelements'),
393 array( $this, 'print_section_info8' ),
394 'my-sticky-elements-settings8'
395 );
396 add_settings_field(
397 'myfixed_element_enable',
398 esc_html__("Enable Element", 'mystickyelements'),
399 array( $this, 'myfixed_element8_enable_callback' ),
400 'my-sticky-elements-settings8',
401 'setting_section_id'
402 );
403
404 add_settings_field(
405 'myfixed_element_side_position',
406 esc_html__("Horizontal Position", 'mystickyelements'),
407 array( $this, 'myfixed_element8_side_position_callback' ),
408 'my-sticky-elements-settings8',
409 'setting_section_id'
410 );
411 add_settings_field(
412 'myfixed_element_top_position',
413 esc_html__("Vertical Position", 'mystickyelements'),
414 array( $this, 'myfixed_element8_top_position_callback' ),
415 'my-sticky-elements-settings8',
416 'setting_section_id'
417 );
418 add_settings_field(
419 'myfixed_element_icon_bg_color',
420 esc_html__("Icon bg Color", 'mystickyelements'),
421 array( $this, 'myfixed_element8_icon_bg_color_callback' ),
422 'my-sticky-elements-settings8',
423 'setting_section_id'
424 );
425 add_settings_field(
426 'myfixed_element_icon_bg_img',
427 esc_html__("Icon bg Image", 'mystickyelements'),
428 array( $this, 'myfixed_element8_icon_bg_img_callback' ),
429 'my-sticky-elements-settings8',
430 'setting_section_id'
431 );
432 add_settings_field(
433 'myfixed_element_content_bg_color',
434 esc_html__("Content bg Color", 'mystickyelements'),
435 array( $this, 'myfixed_element8_content_bg_color_callback' ),
436 'my-sticky-elements-settings8',
437 'setting_section_id'
438 );
439 add_settings_field(
440 'myfixed_element_content_txt_color',
441 esc_html__("Content Text Color", 'mystickyelements'),
442 array( $this, 'myfixed_element8_content_txt_color_callback' ),
443 'my-sticky-elements-settings8',
444 'setting_section_id'
445 );
446 add_settings_field(
447 'myfixed_element_content_width',
448 esc_html__("Content Width", 'mystickyelements'),
449 array( $this, 'myfixed_element8_content_width_callback' ),
450 'my-sticky-elements-settings8',
451 'setting_section_id'
452 );
453 add_settings_field(
454 'myfixed_element_content_padding',
455 esc_html__("Content Padding", 'mystickyelements'),
456 array( $this, 'myfixed_element8_content_padding_callback' ),
457 'my-sticky-elements-settings8',
458 'setting_section_id'
459 );
460 add_settings_field(
461 'myfixed_element_content',
462 esc_html__("Content", 'mystickyelements'),
463 array( $this, 'myfixed_element8_content_callback' ),
464 'my-sticky-elements-settings8',
465 'setting_section_id'
466 );
467
468 //** Third element 7 **//
469
470 add_settings_section(
471 'setting_section_id',
472 esc_html__("myStickyElements Options", 'mystickyelements'),
473 array( $this, 'print_section_info7' ),
474 'my-sticky-elements-settings7'
475 );
476 add_settings_field(
477 'myfixed_element_enable',
478 esc_html__("Enable Element", 'mystickyelements'),
479 array( $this, 'myfixed_element7_enable_callback' ),
480 'my-sticky-elements-settings7',
481 'setting_section_id'
482 );
483 add_settings_field(
484 'myfixed_element_side_position',
485 esc_html__("Horizontal Position", 'mystickyelements'),
486 array( $this, 'myfixed_element7_side_position_callback' ),
487 'my-sticky-elements-settings7',
488 'setting_section_id'
489 );
490 add_settings_field(
491 'myfixed_element_top_position',
492 esc_html__("Vertical Position", 'mystickyelements'),
493 array( $this, 'myfixed_element7_top_position_callback' ),
494 'my-sticky-elements-settings7',
495 'setting_section_id'
496 );
497 add_settings_field(
498 'myfixed_element_icon_bg_color',
499 esc_html__("Icon bg Color", 'mystickyelements'),
500 array( $this, 'myfixed_element7_icon_bg_color_callback' ),
501 'my-sticky-elements-settings7',
502 'setting_section_id'
503 );
504 add_settings_field(
505 'myfixed_element_icon_bg_img',
506 esc_html__("Icon bg Image", 'mystickyelements'),
507 array( $this, 'myfixed_element7_icon_bg_img_callback' ),
508 'my-sticky-elements-settings7',
509 'setting_section_id'
510 );
511 add_settings_field(
512 'myfixed_element_content_bg_color',
513 esc_html__("Content bg Color", 'mystickyelements'),
514 array( $this, 'myfixed_element7_content_bg_color_callback' ),
515 'my-sticky-elements-settings7',
516 'setting_section_id'
517 );
518 add_settings_field(
519 'myfixed_element_content_txt_color',
520 esc_html__("Content Text Color", 'mystickyelements'),
521 array( $this, 'myfixed_element7_content_txt_color_callback' ),
522 'my-sticky-elements-settings7',
523 'setting_section_id'
524 );
525 add_settings_field(
526 'myfixed_element_content_width',
527 esc_html__("Content Width", 'mystickyelements'),
528 array( $this, 'myfixed_element7_content_width_callback' ),
529 'my-sticky-elements-settings7',
530 'setting_section_id'
531 );
532 add_settings_field(
533 'myfixed_element_content_padding',
534 esc_html__("Content Padding", 'mystickyelements'),
535 array( $this, 'myfixed_element7_content_padding_callback' ),
536 'my-sticky-elements-settings7',
537 'setting_section_id'
538 );
539 add_settings_field(
540 'myfixed_element_content',
541 esc_html__("Content", 'mystickyelements'),
542 array( $this, 'myfixed_element7_content_callback' ),
543 'my-sticky-elements-settings7',
544 'setting_section_id'
545 );
546
547 //** Fourth element 6 **//
548
549 add_settings_section(
550 'setting_section_id',
551 esc_html__("myStickyElements Options", 'mystickyelements'),
552 array( $this, 'print_section_info6' ),
553 'my-sticky-elements-settings6'
554 );
555 add_settings_field(
556 'myfixed_element_enable',
557 esc_html__("Enable Element", 'mystickyelements'),
558 array( $this, 'myfixed_element6_enable_callback' ),
559 'my-sticky-elements-settings6',
560 'setting_section_id'
561 );
562 add_settings_field(
563 'myfixed_element_side_position',
564 esc_html__("Horizontal Position", 'mystickyelements'),
565 array( $this, 'myfixed_element6_side_position_callback' ),
566 'my-sticky-elements-settings6',
567 'setting_section_id'
568 );
569 add_settings_field(
570 'myfixed_element_top_position',
571 esc_html__("Vertical Position", 'mystickyelements'),
572 array( $this, 'myfixed_element6_top_position_callback' ),
573 'my-sticky-elements-settings6',
574 'setting_section_id'
575 );
576 add_settings_field(
577 'myfixed_element_icon_bg_color',
578 esc_html__("Icon bg Color", 'mystickyelements'),
579 array( $this, 'myfixed_element6_icon_bg_color_callback' ),
580 'my-sticky-elements-settings6',
581 'setting_section_id'
582 );
583 add_settings_field(
584 'myfixed_element_icon_bg_img',
585 esc_html__("Icon bg Image", 'mystickyelements'),
586 array( $this, 'myfixed_element6_icon_bg_img_callback' ),
587 'my-sticky-elements-settings6',
588 'setting_section_id'
589 );
590 add_settings_field(
591 'myfixed_element_content_bg_color',
592 esc_html__("Content bg Color", 'mystickyelements'),
593 array( $this, 'myfixed_element6_content_bg_color_callback' ),
594 'my-sticky-elements-settings6',
595 'setting_section_id'
596 );
597 add_settings_field(
598 'myfixed_element_content_txt_color',
599 esc_html__("Content Text Color", 'mystickyelements'),
600 array( $this, 'myfixed_element6_content_txt_color_callback' ),
601 'my-sticky-elements-settings6',
602 'setting_section_id'
603 );
604 add_settings_field(
605 'myfixed_element_content_width',
606 esc_html__("Content Width", 'mystickyelements'),
607 array( $this, 'myfixed_element6_content_width_callback' ),
608 'my-sticky-elements-settings6',
609 'setting_section_id'
610 );
611 add_settings_field(
612 'myfixed_element_content_padding',
613 esc_html__("Content Padding", 'mystickyelements'),
614 array( $this, 'myfixed_element6_content_padding_callback' ),
615 'my-sticky-elements-settings6',
616 'setting_section_id'
617 );
618 add_settings_field(
619 'myfixed_element_content',
620 esc_html__("Content", 'mystickyelements'),
621 array( $this, 'myfixed_element6_content_callback' ),
622 'my-sticky-elements-settings6',
623 'setting_section_id'
624 );
625
626 //** Fifth element 5 **//
627
628 add_settings_section(
629 'setting_section_id',
630 esc_html__("myStickyElements Options", 'mystickyelements'),
631 array( $this, 'print_section_info5' ),
632 'my-sticky-elements-settings5'
633 );
634 add_settings_field(
635 'myfixed_element_enable',
636 esc_html__("Enable Element", 'mystickyelements'),
637 array( $this, 'myfixed_element5_enable_callback' ),
638 'my-sticky-elements-settings5',
639 'setting_section_id'
640 );
641
642
643 add_settings_field(
644 'myfixed_element_side_position',
645 esc_html__("Horizontal Position", 'mystickyelements'),
646 array( $this, 'myfixed_element5_side_position_callback' ),
647 'my-sticky-elements-settings5',
648 'setting_section_id'
649 );
650 add_settings_field(
651 'myfixed_element_top_position',
652 esc_html__("Vertical Position", 'mystickyelements'),
653 array( $this, 'myfixed_element5_top_position_callback' ),
654 'my-sticky-elements-settings5',
655 'setting_section_id'
656 );
657 add_settings_field(
658 'myfixed_element_icon_bg_color',
659 esc_html__("Icon bg Color", 'mystickyelements'),
660 array( $this, 'myfixed_element5_icon_bg_color_callback' ),
661 'my-sticky-elements-settings5',
662 'setting_section_id'
663 );
664 add_settings_field(
665 'myfixed_element_icon_bg_img',
666 esc_html__("Icon bg Image", 'mystickyelements'),
667 array( $this, 'myfixed_element5_icon_bg_img_callback' ),
668 'my-sticky-elements-settings5',
669 'setting_section_id'
670 );
671 add_settings_field(
672 'myfixed_element_content_bg_color',
673 esc_html__("Content bg Color", 'mystickyelements'),
674 array( $this, 'myfixed_element5_content_bg_color_callback' ),
675 'my-sticky-elements-settings5',
676 'setting_section_id'
677 );
678 add_settings_field(
679 'myfixed_element_content_txt_color',
680 esc_html__("Content Text Color", 'mystickyelements'),
681 array( $this, 'myfixed_element5_content_txt_color_callback' ),
682 'my-sticky-elements-settings5',
683 'setting_section_id'
684 );
685 add_settings_field(
686 'myfixed_element_content_width',
687 esc_html__("Content Width", 'mystickyelements'),
688 array( $this, 'myfixed_element5_content_width_callback' ),
689 'my-sticky-elements-settings5',
690 'setting_section_id'
691 );
692 add_settings_field(
693 'myfixed_element_content_padding',
694 esc_html__("Content Padding", 'mystickyelements'),
695 array( $this, 'myfixed_element5_content_padding_callback' ),
696 'my-sticky-elements-settings5',
697 'setting_section_id'
698 );
699 add_settings_field(
700 'myfixed_element_content',
701 esc_html__("Content", 'mystickyelements'),
702 array( $this, 'myfixed_element5_content_callback' ),
703 'my-sticky-elements-settings5',
704 'setting_section_id'
705 );
706
707
708 //** Sixth element 4 **//
709
710 add_settings_section(
711 'setting_section_id',
712 esc_html__("myStickyElements Options", 'mystickyelements'),
713 array( $this, 'print_section_info4' ),
714 'my-sticky-elements-settings4'
715 );
716 add_settings_field(
717 'myfixed_element_enable',
718 esc_html__("Enable Element", 'mystickyelements'),
719 array( $this, 'myfixed_element4_enable_callback' ),
720 'my-sticky-elements-settings4',
721 'setting_section_id'
722 );
723
724
725 add_settings_field(
726 'myfixed_element_side_position',
727 esc_html__("Horizontal Position", 'mystickyelements'),
728 array( $this, 'myfixed_element4_side_position_callback' ),
729 'my-sticky-elements-settings4',
730 'setting_section_id'
731 );
732 add_settings_field(
733 'myfixed_element_top_position',
734 esc_html__("Vertical Position", 'mystickyelements'),
735 array( $this, 'myfixed_element4_top_position_callback' ),
736 'my-sticky-elements-settings4',
737 'setting_section_id'
738 );
739 add_settings_field(
740 'myfixed_element_icon_bg_color',
741 esc_html__("Icon bg Color", 'mystickyelements'),
742 array( $this, 'myfixed_element4_icon_bg_color_callback' ),
743 'my-sticky-elements-settings4',
744 'setting_section_id'
745 );
746 add_settings_field(
747 'myfixed_element_icon_bg_img',
748 esc_html__("Icon bg Image", 'mystickyelements'),
749 array( $this, 'myfixed_element4_icon_bg_img_callback' ),
750 'my-sticky-elements-settings4',
751 'setting_section_id'
752 );
753 add_settings_field(
754 'myfixed_element_content_bg_color',
755 esc_html__("Content bg Color", 'mystickyelements'),
756 array( $this, 'myfixed_element4_content_bg_color_callback' ),
757 'my-sticky-elements-settings4',
758 'setting_section_id'
759 );
760 add_settings_field(
761 'myfixed_element_content_txt_color',
762 esc_html__("Content Text Color", 'mystickyelements'),
763 array( $this, 'myfixed_element4_content_txt_color_callback' ),
764 'my-sticky-elements-settings4',
765 'setting_section_id'
766 );
767 add_settings_field(
768 'myfixed_element_content_width',
769 esc_html__("Content Width", 'mystickyelements'),
770 array( $this, 'myfixed_element4_content_width_callback' ),
771 'my-sticky-elements-settings4',
772 'setting_section_id'
773 );
774 add_settings_field(
775 'myfixed_element_content_padding',
776 esc_html__("Content Padding", 'mystickyelements'),
777 array( $this, 'myfixed_element4_content_padding_callback' ),
778 'my-sticky-elements-settings4',
779 'setting_section_id'
780 );
781 add_settings_field(
782 'myfixed_element_content',
783 esc_html__("Content", 'mystickyelements'),
784 array( $this, 'myfixed_element4_content_callback' ),
785 'my-sticky-elements-settings4',
786 'setting_section_id'
787 );
788
789
790
791
792
793 //** Sevnth element 3 **//
794
795 add_settings_section(
796 'setting_section_id',
797 esc_html__("myStickyElements Options", 'mystickyelements'),
798 array( $this, 'print_section_info3' ),
799 'my-sticky-elements-settings3'
800 );
801 add_settings_field(
802 'myfixed_element_enable',
803 esc_html__("Enable Element", 'mystickyelements'),
804 array( $this, 'myfixed_element3_enable_callback' ),
805 'my-sticky-elements-settings3',
806 'setting_section_id'
807 );
808
809
810 add_settings_field(
811 'myfixed_element_side_position',
812 esc_html__("Horizontal Position", 'mystickyelements'),
813 array( $this, 'myfixed_element3_side_position_callback' ),
814 'my-sticky-elements-settings3',
815 'setting_section_id'
816 );
817 add_settings_field(
818 'myfixed_element_top_position',
819 esc_html__("Vertical Position", 'mystickyelements'),
820 array( $this, 'myfixed_element3_top_position_callback' ),
821 'my-sticky-elements-settings3',
822 'setting_section_id'
823 );
824 add_settings_field(
825 'myfixed_element_icon_bg_color',
826 esc_html__("Icon bg Color", 'mystickyelements'),
827 array( $this, 'myfixed_element3_icon_bg_color_callback' ),
828 'my-sticky-elements-settings3',
829 'setting_section_id'
830 );
831 add_settings_field(
832 'myfixed_element_icon_bg_img',
833 esc_html__("Icon bg Image", 'mystickyelements'),
834 array( $this, 'myfixed_element3_icon_bg_img_callback' ),
835 'my-sticky-elements-settings3',
836 'setting_section_id'
837 );
838 add_settings_field(
839 'myfixed_element_content_bg_color',
840 esc_html__("Content bg Color", 'mystickyelements'),
841 array( $this, 'myfixed_element3_content_bg_color_callback' ),
842 'my-sticky-elements-settings3',
843 'setting_section_id'
844 );
845 add_settings_field(
846 'myfixed_element_content_txt_color',
847 esc_html__("Content Text Color", 'mystickyelements'),
848 array( $this, 'myfixed_element3_content_txt_color_callback' ),
849 'my-sticky-elements-settings3',
850 'setting_section_id'
851 );
852 add_settings_field(
853 'myfixed_element_content_width',
854 esc_html__("Content Width", 'mystickyelements'),
855 array( $this, 'myfixed_element3_content_width_callback' ),
856 'my-sticky-elements-settings3',
857 'setting_section_id'
858 );
859 add_settings_field(
860 'myfixed_element_content_padding',
861 esc_html__("Content Padding", 'mystickyelements'),
862 array( $this, 'myfixed_element3_content_padding_callback' ),
863 'my-sticky-elements-settings3',
864 'setting_section_id'
865 );
866 add_settings_field(
867 'myfixed_element_content',
868 esc_html__("Content", 'mystickyelements'),
869 array( $this, 'myfixed_element3_content_callback' ),
870 'my-sticky-elements-settings3',
871 'setting_section_id'
872 );
873
874
875 //** Eight element 2 **//
876
877 add_settings_section(
878 'setting_section_id',
879 esc_html__("myStickyElements Options", 'mystickyelements'),
880 array( $this, 'print_section_info2' ),
881 'my-sticky-elements-settings2'
882 );
883 add_settings_field(
884 'myfixed_element_enable',
885 esc_html__("Enable Element", 'mystickyelements'),
886 array( $this, 'myfixed_element2_enable_callback' ),
887 'my-sticky-elements-settings2',
888 'setting_section_id'
889 );
890
891
892 add_settings_field(
893 'myfixed_element_side_position',
894 esc_html__("Horizontal Position", 'mystickyelements'),
895 array( $this, 'myfixed_element2_side_position_callback' ),
896 'my-sticky-elements-settings2',
897 'setting_section_id'
898 );
899 add_settings_field(
900 'myfixed_element_top_position',
901 esc_html__("Vertical Position", 'mystickyelements'),
902 array( $this, 'myfixed_element2_top_position_callback' ),
903 'my-sticky-elements-settings2',
904 'setting_section_id'
905 );
906 add_settings_field(
907 'myfixed_element_icon_bg_color',
908 esc_html__("Icon bg Color", 'mystickyelements'),
909 array( $this, 'myfixed_element2_icon_bg_color_callback' ),
910 'my-sticky-elements-settings2',
911 'setting_section_id'
912 );
913 add_settings_field(
914 'myfixed_element_icon_bg_img',
915 esc_html__("Icon bg Image", 'mystickyelements'),
916 array( $this, 'myfixed_element2_icon_bg_img_callback' ),
917 'my-sticky-elements-settings2',
918 'setting_section_id'
919 );
920 add_settings_field(
921 'myfixed_element_content_bg_color',
922 esc_html__("Content bg Color", 'mystickyelements'),
923 array( $this, 'myfixed_element2_content_bg_color_callback' ),
924 'my-sticky-elements-settings2',
925 'setting_section_id'
926 );
927 add_settings_field(
928 'myfixed_element_content_txt_color',
929 esc_html__("Content Text Color", 'mystickyelements'),
930 array( $this, 'myfixed_element2_content_txt_color_callback' ),
931 'my-sticky-elements-settings2',
932 'setting_section_id'
933 );
934 add_settings_field(
935 'myfixed_element_content_width',
936 esc_html__("Content Width", 'mystickyelements'),
937 array( $this, 'myfixed_element2_content_width_callback' ),
938 'my-sticky-elements-settings2',
939 'setting_section_id'
940 );
941 add_settings_field(
942 'myfixed_element_content_padding',
943 esc_html__("Content Padding", 'mystickyelements'),
944 array( $this, 'myfixed_element2_content_padding_callback' ),
945 'my-sticky-elements-settings2',
946 'setting_section_id'
947 );
948 add_settings_field(
949 'myfixed_element_content',
950 esc_html__("Content", 'mystickyelements'),
951 array( $this, 'myfixed_element2_content_callback' ),
952 'my-sticky-elements-settings2',
953 'setting_section_id'
954 );
955
956
957 //** Ninth element 1 **//
958
959 add_settings_section(
960 'setting_section_id',
961 esc_html__("myStickyElements Options", 'mystickyelements'),
962 array( $this, 'print_section_info1' ),
963 'my-sticky-elements-settings1'
964 );
965 add_settings_field(
966 'myfixed_element_enable',
967 esc_html__("Enable Element", 'mystickyelements'),
968 array( $this, 'myfixed_element1_enable_callback' ),
969 'my-sticky-elements-settings1',
970 'setting_section_id'
971 );
972
973
974 add_settings_field(
975 'myfixed_element_side_position',
976 esc_html__("Horizontal Position", 'mystickyelements'),
977 array( $this, 'myfixed_element1_side_position_callback' ),
978 'my-sticky-elements-settings1',
979 'setting_section_id'
980 );
981 add_settings_field(
982 'myfixed_element_top_position',
983 esc_html__("Vertical Position", 'mystickyelements'),
984 array( $this, 'myfixed_element1_top_position_callback' ),
985 'my-sticky-elements-settings1',
986 'setting_section_id'
987 );
988 add_settings_field(
989 'myfixed_element_icon_bg_color',
990 esc_html__("Icon bg Color", 'mystickyelements'),
991 array( $this, 'myfixed_element1_icon_bg_color_callback' ),
992 'my-sticky-elements-settings1',
993 'setting_section_id'
994 );
995 add_settings_field(
996 'myfixed_element_icon_bg_img',
997 esc_html__("Icon bg Image", 'mystickyelements'),
998 array( $this, 'myfixed_element1_icon_bg_img_callback' ),
999 'my-sticky-elements-settings1',
1000 'setting_section_id'
1001 );
1002 add_settings_field(
1003 'myfixed_element_content_bg_color',
1004 esc_html__("Content bg Color", 'mystickyelements'),
1005 array( $this, 'myfixed_element1_content_bg_color_callback' ),
1006 'my-sticky-elements-settings1',
1007 'setting_section_id'
1008 );
1009 add_settings_field(
1010 'myfixed_element_content_txt_color',
1011 esc_html__("Content Text Color", 'mystickyelements'),
1012 array( $this, 'myfixed_element1_content_txt_color_callback' ),
1013 'my-sticky-elements-settings1',
1014 'setting_section_id'
1015 );
1016 add_settings_field(
1017 'myfixed_element_content_width',
1018 esc_html__("Content Width", 'mystickyelements'),
1019 array( $this, 'myfixed_element1_content_width_callback' ),
1020 'my-sticky-elements-settings1',
1021 'setting_section_id'
1022 );
1023 add_settings_field(
1024 'myfixed_element_content_padding',
1025 esc_html__("Content Padding", 'mystickyelements'),
1026 array( $this, 'myfixed_element1_content_padding_callback' ),
1027 'my-sticky-elements-settings1',
1028 'setting_section_id'
1029 );
1030 add_settings_field(
1031 'myfixed_element_content',
1032 esc_html__("Content", 'mystickyelements'),
1033 array( $this, 'myfixed_element1_content_callback' ),
1034 'my-sticky-elements-settings1',
1035 'setting_section_id'
1036 );
1037
1038
1039 //** Tenth element 0 **//
1040
1041 add_settings_section(
1042 'setting_section_id',
1043 esc_html__("myStickyElements Options", 'mystickyelements'),
1044 array( $this, 'print_section_info0' ),
1045 'my-sticky-elements-settings0'
1046 );
1047 add_settings_field(
1048 'myfixed_element_enable',
1049 esc_html__("Enable Element", 'mystickyelements'),
1050 array( $this, 'myfixed_element0_enable_callback' ),
1051 'my-sticky-elements-settings0',
1052 'setting_section_id'
1053 );
1054
1055
1056 add_settings_field(
1057 'myfixed_element_side_position',
1058 esc_html__("Horizontal Position", 'mystickyelements'),
1059 array( $this, 'myfixed_element0_side_position_callback' ),
1060 'my-sticky-elements-settings0',
1061 'setting_section_id'
1062 );
1063 add_settings_field(
1064 'myfixed_element_top_position',
1065 esc_html__("Vertical Position", 'mystickyelements'),
1066 array( $this, 'myfixed_element0_top_position_callback' ),
1067 'my-sticky-elements-settings0',
1068 'setting_section_id'
1069 );
1070 add_settings_field(
1071 'myfixed_element_icon_bg_color',
1072 esc_html__("Icon bg Color", 'mystickyelements'),
1073 array( $this, 'myfixed_element0_icon_bg_color_callback' ),
1074 'my-sticky-elements-settings0',
1075 'setting_section_id'
1076 );
1077 add_settings_field(
1078 'myfixed_element_icon_bg_img',
1079 esc_html__("Icon bg Image", 'mystickyelements'),
1080 array( $this, 'myfixed_element0_icon_bg_img_callback' ),
1081 'my-sticky-elements-settings0',
1082 'setting_section_id'
1083 );
1084 add_settings_field(
1085 'myfixed_element_content_bg_color',
1086 esc_html__("Content bg Color", 'mystickyelements'),
1087 array( $this, 'myfixed_element0_content_bg_color_callback' ),
1088 'my-sticky-elements-settings0',
1089 'setting_section_id'
1090 );
1091 add_settings_field(
1092 'myfixed_element_content_txt_color',
1093 esc_html__("Content Text Color", 'mystickyelements'),
1094 array( $this, 'myfixed_element0_content_txt_color_callback' ),
1095 'my-sticky-elements-settings0',
1096 'setting_section_id'
1097 );
1098 add_settings_field(
1099 'myfixed_element_content_width',
1100 esc_html__("Content Width", 'mystickyelements'),
1101 array( $this, 'myfixed_element0_content_width_callback' ),
1102 'my-sticky-elements-settings0',
1103 'setting_section_id'
1104 );
1105 add_settings_field(
1106 'myfixed_element_content_padding',
1107 esc_html__("Content Padding", 'mystickyelements'),
1108 array( $this, 'myfixed_element0_content_padding_callback' ),
1109 'my-sticky-elements-settings0',
1110 'setting_section_id'
1111 );
1112 add_settings_field(
1113 'myfixed_element_content',
1114 esc_html__("Content", 'mystickyelements'),
1115 array( $this, 'myfixed_element0_content_callback' ),
1116 'my-sticky-elements-settings0',
1117 'setting_section_id'
1118 );
1119
1120 }
1121
1122
1123
1124 /**
1125 * Sanitize each setting field as needed
1126 * @param array $input Contains all settings fields as array keys
1127 */
1128 public function sanitize($input)
1129 {
1130
1131 $new_input = array();
1132 if (isset($input['myfixed_element_enable'])) {
1133 $new_input['myfixed_element_enable'] = sanitize_text_field($input['myfixed_element_enable']);
1134 }
1135
1136 if (isset($input['myfixed_element_side_position'])) {
1137 $new_input['myfixed_element_side_position'] = sanitize_text_field($input['myfixed_element_side_position']);
1138 }
1139
1140 if (isset($input['myfixed_element_top_position'])) {
1141 $new_input['myfixed_element_top_position'] = absint($input['myfixed_element_top_position']);
1142 }
1143
1144 if (isset($input['myfixed_element_icon_bg_color'])) {
1145 $new_input['myfixed_element_icon_bg_color'] = sanitize_text_field($input['myfixed_element_icon_bg_color']);
1146 }
1147
1148 if (isset($input['myfixed_element_icon_bg_img'])) {
1149 $new_input['myfixed_element_icon_bg_img'] = sanitize_text_field($input['myfixed_element_icon_bg_img']);
1150 }
1151
1152 if (isset($input['myfixed_element_content_bg_color'])) {
1153 $new_input['myfixed_element_content_bg_color'] = sanitize_text_field($input['myfixed_element_content_bg_color']);
1154 }
1155
1156 if (isset($input['myfixed_element_content_txt_color'])) {
1157 $new_input['myfixed_element_content_txt_color'] = sanitize_text_field($input['myfixed_element_content_txt_color']);
1158 }
1159
1160 if (isset($input['myfixed_element_content_width'])) {
1161 $new_input['myfixed_element_content_width'] = absint($input['myfixed_element_content_width']);
1162 }
1163
1164 if (isset($input['myfixed_element_content_padding'])) {
1165 $new_input['myfixed_element_content_padding'] = absint($input['myfixed_element_content_padding']);
1166 }
1167
1168 if (isset($input['myfixed_element_content'])) {
1169 $new_input['myfixed_element_content'] = wp_kses(
1170 $input['myfixed_element_content'],
1171 array(
1172 'a' => array(
1173 'href' => array(),
1174 'title' => array(),
1175 'target' => array(),
1176 'rel' => array()
1177 ),
1178 'br' => array(),
1179 'h1' => array(),
1180 'h2' => array(),
1181 'h3' => array(),
1182 'h4' => array(),
1183 'h5' => array(),
1184 'h6' => array(),
1185 '&nbsp;' => array(),
1186 'hr' => array(),
1187 'p' => array(),
1188 'em' => array(),
1189 'strong' => array(),
1190 'ul' => array(),
1191 'ol' => array(),
1192 'li' => array(),
1193 'blockquote' => array(),
1194 'iframe' => array(
1195 'src' => array(),
1196 'width' => array(),
1197 'height' => array(),
1198 'frameborder' => array(),
1199 'allowfullscreen' => array(),
1200 'scrolling' => array(),
1201 'style' => array(),
1202 'allowtransparency' => array()
1203 ),
1204 'img' => array(
1205 'src' => array(),
1206 'alt' => array(),
1207 'class' => array(),
1208 'width' => array(),
1209 'height' => array(),
1210 'rel' => array()
1211 ),
1212 'span' => array(
1213 'style' => array(),
1214 'class' => array()
1215 )
1216
1217 )
1218 );
1219 }
1220
1221
1222 if (isset($input['myfixed_zindex'])) {
1223 $new_input['myfixed_zindex'] = absint($input['myfixed_zindex']);
1224 }
1225
1226 if (isset($input['myfixed_disable_small_screen'])) {
1227 $new_input['myfixed_disable_small_screen'] = absint($input['myfixed_disable_small_screen']);
1228 }
1229
1230
1231 if (isset($input['myfixed_click'])) {
1232 $new_input['myfixed_click'] = sanitize_text_field($input['myfixed_click']);
1233 }
1234
1235 if (isset($input['myfixed_cssstyle'])) {
1236 $new_input['myfixed_cssstyle'] = sanitize_text_field($input['myfixed_cssstyle']);
1237 }
1238
1239
1240 return $new_input;
1241 }
1242
1243 public function mw_enqueue_color_picker()
1244 {
1245 wp_enqueue_style('wp-color-picker');
1246 wp_enqueue_script('my-script-handle', plugins_url('dist/js/iris-script.js', __FILE__), array( 'wp-color-picker' ), false, true);
1247 }
1248
1249
1250
1251 /* ***** GENERAL ***** */
1252
1253 public function print_section_info()
1254 {
1255 esc_html_e('Add sticky elements to your blog.', 'mystickyelements');
1256
1257 }
1258 /**
1259 * Get the settings option array and print one of its values
1260 */
1261
1262 public function myfixed_disable_small_screen_callback()
1263 {
1264 printf(
1265 '<p class="description">'. esc_html__('less than ', 'mystickyelements') .'<input type="text" size="4" id="myfixed_disable_small_screen" name="mysticky_elements_options[myfixed_disable_small_screen]" value="%s" />'. esc_html__('px width, 0 to disable.', 'mystickyelements') .'</p>',
1266 isset($this->options['myfixed_disable_small_screen']) ? esc_attr($this->options['myfixed_disable_small_screen']) : ''
1267 );
1268 }
1269
1270 /*public function mysticky_active_on_height_callback()
1271 {
1272 printf(
1273 '<p class="description">after <input type="text" size="4" id="mysticky_active_on_height" name="mysticky_elements_options[mysticky_active_on_height]" value="%s" />px</p>',
1274 isset( $this->options['mysticky_active_on_height'] ) ? esc_attr( $this->options['mysticky_active_on_height']) : ''
1275 );
1276 }*/
1277
1278
1279 public function myfixed_click_callback()
1280 {
1281 printf(
1282 '<select id="myfixed_click" name="mysticky_elements_options[myfixed_click]" selected="%s">',
1283 isset($this->options['myfixed_click']) ? esc_attr($this->options['myfixed_click']) : ''
1284 );
1285 if ($this->options['myfixed_click'] == 'click') {
1286 printf(
1287 '<option name="click" value="click" selected>'. esc_html__('click', 'mystickyelements') .'</option>
1288 <option name="hover" value="hover">'. esc_html__('hover', 'mystickyelements') .'</option>
1289 </select>'
1290 );
1291 }
1292 if ($this->options['myfixed_click'] == 'hover') {
1293 printf(
1294 '<option name="click" value="click">'. esc_html__('click', 'mystickyelements') .'</option>
1295 <option name="hover" value="hover" selected >'. esc_html__('hover', 'mystickyelements') .'</option>
1296 </select>'
1297 );
1298 }
1299 if ($this->options['myfixed_click'] == '') {
1300 printf(
1301 '<option name="click" value="click" selected>'. esc_html__('click', 'mystickyelements') .'</option>
1302 <option name="hover" value="hover">'. esc_html__('hover', 'mystickyelements') .'</option>
1303 </select>'
1304 );
1305 }
1306 }
1307
1308 public function myfixed_cssstyle_callback()
1309 {
1310 printf(
1311 '
1312 <p class="description">'. esc_html__('Add/Edit css to manage advanced elements style.', 'mystickyelements') .'</p> <textarea type="text" rows="4" cols="60" id="myfixed_cssstyle" name="mysticky_elements_options[myfixed_cssstyle]">%s</textarea> <br />
1313 ',
1314 isset($this->options['myfixed_cssstyle']) ? esc_attr($this->options['myfixed_cssstyle']) : ''
1315 );
1316 echo '</p>';
1317 }
1318
1319
1320 /* ***** ELEMENT 1 ***** */
1321
1322 public function print_section_info9()
1323 {
1324 esc_html_e('Element 1 Settings.', 'mystickyelements');
1325 }
1326
1327
1328 public function myfixed_element9_enable_callback()
1329 {
1330 printf(
1331 '<select id="myfixed_element_enable" name="mysticky_elements_options9[myfixed_element_enable]" selected="%s">',
1332 isset($this->options9['myfixed_element_enable']) ? esc_attr($this->options9['myfixed_element_enable']) : ''
1333 );
1334 if ($this->options9['myfixed_element_enable'] == 'enable') {
1335 printf(
1336 '<option name="enable" value="enable" selected>enable</option>
1337 <option name="disable" value="disable">disable</option>
1338 </select>'
1339 );
1340 }
1341 if ($this->options9['myfixed_element_enable'] == 'disable') {
1342 printf(
1343 '<option name="enable" value="enable">enable</option>
1344 <option name="disable" value="disable" selected >disable</option>
1345 </select>'
1346 );
1347 }
1348 if ($this->options9['myfixed_element_enable'] == '') {
1349 printf(
1350 '<option name="enable" value="enable" >enable</option>
1351 <option name="disable" value="disable" selected >disable</option>
1352 </select>'
1353 );
1354 }
1355 }
1356
1357
1358
1359
1360
1361 public function myfixed_element9_side_position_callback()
1362 {
1363 printf(
1364 '<select id="myfixed_element_side_position" name="mysticky_elements_options9[myfixed_element_side_position]" selected="%s">',
1365 isset($this->options9['myfixed_element_side_position']) ? esc_attr($this->options9['myfixed_element_side_position']) : ''
1366 );
1367 if ($this->options9['myfixed_element_side_position'] == 'left') {
1368 printf(
1369 '<option name="left" value="left" selected>left</option>
1370 <option name="right" value="right">right</option>
1371 </select>'
1372 );
1373 }
1374 if ($this->options9['myfixed_element_side_position'] == 'right') {
1375 printf(
1376 '<option name="left" value="left">left</option>
1377 <option name="right" value="right" selected >right</option>
1378 </select>'
1379 );
1380 }
1381 if ($this->options9['myfixed_element_side_position'] == '') {
1382 printf(
1383 '<option name="left" value="left" selected>left</option>
1384 <option name="right" value="right">right</option>
1385 </select>'
1386 );
1387 }
1388 }
1389
1390 public function myfixed_element9_top_position_callback()
1391 {
1392 printf(
1393 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options9[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
1394 isset($this->options9['myfixed_element_top_position']) ? esc_attr($this->options9['myfixed_element_top_position']) : ''
1395 );
1396 }
1397 public function myfixed_element9_icon_bg_color_callback()
1398 {
1399 printf(
1400 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options9[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
1401 isset($this->options9['myfixed_element_icon_bg_color']) ? esc_attr($this->options9['myfixed_element_icon_bg_color']) : ''
1402 );
1403 }
1404 public function myfixed_element9_icon_bg_img_callback()
1405 {
1406 printf(
1407 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options9[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
1408 isset($this->options9['myfixed_element_icon_bg_img']) ? esc_attr($this->options9['myfixed_element_icon_bg_img']) : ''
1409 );
1410 }
1411 public function myfixed_element9_content_bg_color_callback()
1412 {
1413 printf(
1414 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options9[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
1415 isset($this->options9['myfixed_element_content_bg_color']) ? esc_attr($this->options9['myfixed_element_content_bg_color']) : ''
1416 );
1417 }
1418 public function myfixed_element9_content_txt_color_callback()
1419 {
1420 printf(
1421 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options9[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
1422 isset($this->options9['myfixed_element_content_txt_color']) ? esc_attr($this->options9['myfixed_element_content_txt_color']) : ''
1423 );
1424 }
1425 public function myfixed_element9_content_width_callback()
1426 {
1427 printf(
1428 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options9[myfixed_element_content_width]" value="%s" />px</p>',
1429 isset($this->options9['myfixed_element_content_width']) ? esc_attr($this->options9['myfixed_element_content_width']) : ''
1430 );
1431 }
1432
1433
1434 public function myfixed_element9_content_padding_callback()
1435 {
1436 printf(
1437 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options9[myfixed_element_content_padding]" value="%s" />px</p>',
1438 isset($this->options9['myfixed_element_content_padding']) ? esc_attr($this->options9['myfixed_element_content_padding']) : ''
1439 );
1440 }
1441
1442
1443
1444 public function myfixed_element9_content_callback()
1445 {
1446 $content_id = 'myfixed_element_content';
1447 $content = (isset($this->options9['myfixed_element_content']) ? esc_textarea($this->options9['myfixed_element_content']) : '');
1448
1449 wp_editor(
1450 html_entity_decode($content),
1451 $content_id,
1452 array(
1453 'textarea_name' => 'mysticky_elements_options9[myfixed_element_content]',
1454 //'teeny' => true,
1455 //'tinymce' => true,
1456 'textarea_rows' => get_option('default_post_edit_rows', 8)
1457 )
1458 );
1459 }
1460
1461
1462 /* ***** ELEMENT 2 ***** */
1463
1464 public function print_section_info8()
1465 {
1466 esc_html_e('Element 2 Settings.', 'mystickyelements');
1467 }
1468
1469 public function myfixed_element8_enable_callback()
1470 {
1471 printf(
1472 '<select id="myfixed_element_enable" name="mysticky_elements_options8[myfixed_element_enable]" selected="%s">',
1473 isset($this->options8['myfixed_element_enable']) ? esc_attr($this->options8['myfixed_element_enable']) : ''
1474 );
1475 if ($this->options8['myfixed_element_enable'] == 'enable') {
1476 printf(
1477 '<option name="enable" value="enable" selected>enable</option>
1478 <option name="disable" value="disable">disable</option>
1479 </select>'
1480 );
1481 }
1482 if ($this->options8['myfixed_element_enable'] == 'disable') {
1483 printf(
1484 '<option name="enable" value="enable">enable</option>
1485 <option name="disable" value="disable" selected >disable</option>
1486 </select>'
1487 );
1488 }
1489 if ($this->options8['myfixed_element_enable'] == '') {
1490 printf(
1491 '<option name="enable" value="enable" >enable</option>
1492 <option name="disable" value="disable" selected >disable</option>
1493 </select>'
1494 );
1495 }
1496 }
1497
1498
1499 public function myfixed_element8_side_position_callback()
1500 {
1501
1502 printf(
1503 '<select id="myfixed_element_side_position" name="mysticky_elements_options8[myfixed_element_side_position]" selected="%s">',
1504 isset($this->options8['myfixed_element_side_position']) ? esc_attr($this->options8['myfixed_element_side_position']) : ''
1505 );
1506 if ($this->options8['myfixed_element_side_position'] == 'left') {
1507 printf(
1508 '<option name="left" value="left" selected>left</option>
1509 <option name="right" value="right">right</option>
1510 </select>'
1511 );
1512 }
1513 if ($this->options8['myfixed_element_side_position'] == 'right') {
1514 printf(
1515 '<option name="left" value="left">left</option>
1516 <option name="right" value="right" selected >right</option>
1517 </select>'
1518 );
1519 }
1520 if ($this->options8['myfixed_element_side_position'] == '') {
1521 printf(
1522 '<option name="left" value="left" selected>left</option>
1523 <option name="right" value="right">right</option>
1524 </select>'
1525 );
1526 }
1527 }
1528
1529 public function myfixed_element8_top_position_callback()
1530 {
1531 printf(
1532 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options8[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
1533 isset($this->options8['myfixed_element_top_position']) ? esc_attr($this->options8['myfixed_element_top_position']) : ''
1534 );
1535 }
1536 public function myfixed_element8_icon_bg_color_callback()
1537 {
1538 printf(
1539 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options8[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
1540 isset($this->options8['myfixed_element_icon_bg_color']) ? esc_attr($this->options8['myfixed_element_icon_bg_color']) : ''
1541 );
1542 }
1543 public function myfixed_element8_icon_bg_img_callback()
1544 {
1545 printf(
1546 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options8[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
1547 isset($this->options8['myfixed_element_icon_bg_img']) ? esc_attr($this->options8['myfixed_element_icon_bg_img']) : ''
1548 );
1549 }
1550 public function myfixed_element8_content_bg_color_callback()
1551 {
1552 printf(
1553 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options8[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
1554 isset($this->options8['myfixed_element_content_bg_color']) ? esc_attr($this->options8['myfixed_element_content_bg_color']) : ''
1555 );
1556 }
1557 public function myfixed_element8_content_txt_color_callback()
1558 {
1559 printf(
1560 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options8[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
1561 isset($this->options8['myfixed_element_content_txt_color']) ? esc_attr($this->options8['myfixed_element_content_txt_color']) : ''
1562 );
1563 }
1564 public function myfixed_element8_content_width_callback()
1565 {
1566 printf(
1567 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options8[myfixed_element_content_width]" value="%s" />px</p>',
1568 isset($this->options8['myfixed_element_content_width']) ? esc_attr($this->options8['myfixed_element_content_width']) : ''
1569 );
1570 }
1571 public function myfixed_element8_content_padding_callback()
1572 {
1573 printf(
1574 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options8[myfixed_element_content_padding]" value="%s" />px</p>',
1575 isset($this->options8['myfixed_element_content_padding']) ? esc_attr($this->options8['myfixed_element_content_padding']) : ''
1576 );
1577 }
1578
1579
1580 public function myfixed_element8_content_callback()
1581 {
1582 $content_id = 'myfixed_element_content';
1583 $content = (isset($this->options8['myfixed_element_content']) ? esc_textarea($this->options8['myfixed_element_content']) : '');
1584
1585 wp_editor(
1586 html_entity_decode($content),
1587 $content_id,
1588 array(
1589 'textarea_name' => 'mysticky_elements_options8[myfixed_element_content]',
1590 //'teeny' => true,
1591 //'tinymce' => true,
1592 'textarea_rows' => get_option('default_post_edit_rows', 8)
1593 )
1594 );
1595 }
1596
1597
1598 /* ***** ELEMENT 3 ***** */
1599
1600
1601 public function print_section_info7()
1602 {
1603 esc_html_e('Element 3 Settings.', 'mystickyelements');
1604 }
1605
1606
1607 public function myfixed_element7_enable_callback()
1608 {
1609 printf(
1610 '<select id="myfixed_element_enable" name="mysticky_elements_options7[myfixed_element_enable]" selected="%s">',
1611 isset($this->options7['myfixed_element_enable']) ? esc_attr($this->options7['myfixed_element_enable']) : ''
1612 );
1613 if ($this->options7['myfixed_element_enable'] == 'enable') {
1614 printf(
1615 '<option name="enable" value="enable" selected>enable</option>
1616 <option name="disable" value="disable">disable</option>
1617 </select>'
1618 );
1619 }
1620 if ($this->options7['myfixed_element_enable'] == 'disable') {
1621 printf(
1622 '<option name="enable" value="enable">enable</option>
1623 <option name="disable" value="disable" selected >disable</option>
1624 </select>'
1625 );
1626 }
1627 if ($this->options7['myfixed_element_enable'] == '') {
1628 printf(
1629 '<option name="enable" value="enable" >enable</option>
1630 <option name="disable" value="disable" selected >disable</option>
1631 </select>'
1632 );
1633 }
1634 }
1635
1636
1637
1638 public function myfixed_element7_side_position_callback()
1639 {
1640 printf(
1641 '<select id="myfixed_element_side_position" name="mysticky_elements_options7[myfixed_element_side_position]" selected="%s">',
1642 isset($this->options7['myfixed_element_side_position']) ? esc_attr($this->options7['myfixed_element_side_position']) : ''
1643 );
1644 if ($this->options7['myfixed_element_side_position'] == 'left') {
1645 printf(
1646 '<option name="left" value="left" selected>left</option>
1647 <option name="right" value="right">right</option>
1648 </select>'
1649 );
1650 }
1651 if ($this->options7['myfixed_element_side_position'] == 'right') {
1652 printf(
1653 '<option name="left" value="left">left</option>
1654 <option name="right" value="right" selected >right</option>
1655 </select>'
1656 );
1657 }
1658 if ($this->options7['myfixed_element_side_position'] == '') {
1659 printf(
1660 '<option name="left" value="left" selected>left</option>
1661 <option name="right" value="right">right</option>
1662 </select>'
1663 );
1664 }
1665 }
1666 public function myfixed_element7_top_position_callback()
1667 {
1668 printf(
1669 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options7[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
1670 isset($this->options7['myfixed_element_top_position']) ? esc_attr($this->options7['myfixed_element_top_position']) : ''
1671 );
1672 }
1673 public function myfixed_element7_icon_bg_color_callback()
1674 {
1675 printf(
1676 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options7[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
1677 isset($this->options7['myfixed_element_icon_bg_color']) ? esc_attr($this->options7['myfixed_element_icon_bg_color']) : ''
1678 );
1679 }
1680 public function myfixed_element7_icon_bg_img_callback()
1681 {
1682 printf(
1683 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options7[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
1684 isset($this->options7['myfixed_element_icon_bg_img']) ? esc_attr($this->options7['myfixed_element_icon_bg_img']) : ''
1685 );
1686 }
1687 public function myfixed_element7_content_bg_color_callback()
1688 {
1689 printf(
1690 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options7[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
1691 isset($this->options7['myfixed_element_content_bg_color']) ? esc_attr($this->options7['myfixed_element_content_bg_color']) : ''
1692 );
1693 }
1694 public function myfixed_element7_content_txt_color_callback()
1695 {
1696 printf(
1697 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options7[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
1698 isset($this->options7['myfixed_element_content_txt_color']) ? esc_attr($this->options7['myfixed_element_content_txt_color']) : ''
1699 );
1700 }
1701 public function myfixed_element7_content_width_callback()
1702 {
1703 printf(
1704 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options7[myfixed_element_content_width]" value="%s" />px</p>',
1705 isset($this->options7['myfixed_element_content_width']) ? esc_attr($this->options7['myfixed_element_content_width']) : ''
1706 );
1707 }
1708 public function myfixed_element7_content_padding_callback()
1709 {
1710 printf(
1711 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options7[myfixed_element_content_padding]" value="%s" />px</p>',
1712 isset($this->options7['myfixed_element_content_padding']) ? esc_attr($this->options7['myfixed_element_content_padding']) : ''
1713 );
1714 }
1715
1716
1717 public function myfixed_element7_content_callback()
1718 {
1719 $content_id = 'myfixed_element_content';
1720 $content = (isset($this->options7['myfixed_element_content']) ? esc_textarea($this->options7['myfixed_element_content']) : '');
1721
1722 wp_editor(
1723 html_entity_decode($content),
1724 $content_id,
1725 array(
1726 'textarea_name' => 'mysticky_elements_options7[myfixed_element_content]',
1727 //'teeny' => true,
1728 //'tinymce' => true,
1729 'textarea_rows' => get_option('default_post_edit_rows', 8)
1730 )
1731 );
1732 }
1733
1734
1735
1736
1737 /* ***** ELEMENT 4 ***** */
1738
1739
1740 public function print_section_info6()
1741 {
1742 esc_html_e('Element 4 Settings.', 'mystickyelements');
1743 }
1744
1745
1746 public function myfixed_element6_enable_callback()
1747 {
1748 printf(
1749 '<select id="myfixed_element_enable" name="mysticky_elements_options6[myfixed_element_enable]" selected="%s">',
1750 isset($this->options6['myfixed_element_enable']) ? esc_attr($this->options6['myfixed_element_enable']) : ''
1751 );
1752 if ($this->options6['myfixed_element_enable'] == 'enable') {
1753 printf(
1754 '<option name="enable" value="enable" selected>enable</option>
1755 <option name="disable" value="disable">disable</option>
1756 </select>'
1757 );
1758 }
1759 if ($this->options6['myfixed_element_enable'] == 'disable') {
1760 printf(
1761 '<option name="enable" value="enable">enable</option>
1762 <option name="disable" value="disable" selected >disable</option>
1763 </select>'
1764 );
1765 }
1766 if ($this->options6['myfixed_element_enable'] == '') {
1767 printf(
1768 '<option name="enable" value="enable" >enable</option>
1769 <option name="disable" value="disable" selected >disable</option>
1770 </select>'
1771 );
1772 }
1773 }
1774
1775
1776
1777 public function myfixed_element6_side_position_callback()
1778 {
1779 printf(
1780 '<select id="myfixed_element_side_position" name="mysticky_elements_options6[myfixed_element_side_position]" selected="%s">',
1781 isset($this->options6['myfixed_element_side_position']) ? esc_attr($this->options6['myfixed_element_side_position']) : ''
1782 );
1783 if ($this->options6['myfixed_element_side_position'] == 'left') {
1784 printf(
1785 '<option name="left" value="left" selected>left</option>
1786 <option name="right" value="right">right</option>
1787 </select>'
1788 );
1789 }
1790 if ($this->options6['myfixed_element_side_position'] == 'right') {
1791 printf(
1792 '<option name="left" value="left">left</option>
1793 <option name="right" value="right" selected >right</option>
1794 </select>'
1795 );
1796 }
1797 if ($this->options6['myfixed_element_side_position'] == '') {
1798 printf(
1799 '<option name="left" value="left" selected>left</option>
1800 <option name="right" value="right">right</option>
1801 </select>'
1802 );
1803 }
1804 }
1805 public function myfixed_element6_top_position_callback()
1806 {
1807 printf(
1808 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options6[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
1809 isset($this->options6['myfixed_element_top_position']) ? esc_attr($this->options6['myfixed_element_top_position']) : ''
1810 );
1811 }
1812 public function myfixed_element6_icon_bg_color_callback()
1813 {
1814 printf(
1815 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options6[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
1816 isset($this->options6['myfixed_element_icon_bg_color']) ? esc_attr($this->options6['myfixed_element_icon_bg_color']) : ''
1817 );
1818 }
1819 public function myfixed_element6_icon_bg_img_callback()
1820 {
1821 printf(
1822 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options6[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
1823 isset($this->options6['myfixed_element_icon_bg_img']) ? esc_attr($this->options6['myfixed_element_icon_bg_img']) : ''
1824 );
1825 }
1826 public function myfixed_element6_content_bg_color_callback()
1827 {
1828 printf(
1829 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options6[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
1830 isset($this->options6['myfixed_element_content_bg_color']) ? esc_attr($this->options6['myfixed_element_content_bg_color']) : ''
1831 );
1832 }
1833 public function myfixed_element6_content_txt_color_callback()
1834 {
1835 printf(
1836 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options6[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
1837 isset($this->options6['myfixed_element_content_txt_color']) ? esc_attr($this->options6['myfixed_element_content_txt_color']) : ''
1838 );
1839 }
1840 public function myfixed_element6_content_width_callback()
1841 {
1842 printf(
1843 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options6[myfixed_element_content_width]" value="%s" />px</p>',
1844 isset($this->options6['myfixed_element_content_width']) ? esc_attr($this->options6['myfixed_element_content_width']) : ''
1845 );
1846 }
1847 public function myfixed_element6_content_padding_callback()
1848 {
1849 printf(
1850 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options6[myfixed_element_content_padding]" value="%s" />px</p>',
1851 isset($this->options6['myfixed_element_content_padding']) ? esc_attr($this->options6['myfixed_element_content_padding']) : ''
1852 );
1853 }
1854
1855
1856 public function myfixed_element6_content_callback()
1857 {
1858 $content_id = 'myfixed_element_content';
1859 $content = (isset($this->options6['myfixed_element_content']) ? esc_textarea($this->options6['myfixed_element_content']) : '');
1860
1861 wp_editor(
1862 html_entity_decode($content),
1863 $content_id,
1864 array(
1865 'textarea_name' => 'mysticky_elements_options6[myfixed_element_content]',
1866 //'teeny' => true,
1867 //'tinymce' => true,
1868 'textarea_rows' => get_option('default_post_edit_rows', 8)
1869 )
1870 );
1871 }
1872
1873
1874
1875 /* ***** ELEMENT 5 ***** */
1876
1877
1878 public function print_section_info5()
1879 {
1880 esc_html_e('Element 5 Settings.', 'mystickyelements');
1881 }
1882
1883
1884 public function myfixed_element5_enable_callback()
1885 {
1886 printf(
1887 '<select id="myfixed_element_enable" name="mysticky_elements_options5[myfixed_element_enable]" selected="%s">',
1888 isset($this->options5['myfixed_element_enable']) ? esc_attr($this->options5['myfixed_element_enable']) : ''
1889 );
1890 if ($this->options5['myfixed_element_enable'] == 'enable') {
1891 printf(
1892 '<option name="enable" value="enable" selected>enable</option>
1893 <option name="disable" value="disable">disable</option>
1894 </select>'
1895 );
1896 }
1897 if ($this->options5['myfixed_element_enable'] == 'disable') {
1898 printf(
1899 '<option name="enable" value="enable">enable</option>
1900 <option name="disable" value="disable" selected >disable</option>
1901 </select>'
1902 );
1903 }
1904 if ($this->options5['myfixed_element_enable'] == '') {
1905 printf(
1906 '<option name="enable" value="enable" >enable</option>
1907 <option name="disable" value="disable" selected >disable</option>
1908 </select>'
1909 );
1910 }
1911 }
1912
1913
1914
1915 public function myfixed_element5_side_position_callback()
1916 {
1917 printf(
1918 '<select id="myfixed_element_side_position" name="mysticky_elements_options5[myfixed_element_side_position]" selected="%s">',
1919 isset($this->options5['myfixed_element_side_position']) ? esc_attr($this->options5['myfixed_element_side_position']) : ''
1920 );
1921 if ($this->options5['myfixed_element_side_position'] == 'left') {
1922 printf(
1923 '<option name="left" value="left" selected>left</option>
1924 <option name="right" value="right">right</option>
1925 </select>'
1926 );
1927 }
1928 if ($this->options5['myfixed_element_side_position'] == 'right') {
1929 printf(
1930 '<option name="left" value="left">left</option>
1931 <option name="right" value="right" selected >right</option>
1932 </select>'
1933 );
1934 }
1935 if ($this->options5['myfixed_element_side_position'] == '') {
1936 printf(
1937 '<option name="left" value="left" selected>left</option>
1938 <option name="right" value="right">right</option>
1939 </select>'
1940 );
1941 }
1942 }
1943 public function myfixed_element5_top_position_callback()
1944 {
1945 printf(
1946 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options5[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
1947 isset($this->options5['myfixed_element_top_position']) ? esc_attr($this->options5['myfixed_element_top_position']) : ''
1948 );
1949 }
1950 public function myfixed_element5_icon_bg_color_callback()
1951 {
1952 printf(
1953 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options5[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
1954 isset($this->options5['myfixed_element_icon_bg_color']) ? esc_attr($this->options5['myfixed_element_icon_bg_color']) : ''
1955 );
1956 }
1957 public function myfixed_element5_icon_bg_img_callback()
1958 {
1959 printf(
1960 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options5[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
1961 isset($this->options5['myfixed_element_icon_bg_img']) ? esc_attr($this->options5['myfixed_element_icon_bg_img']) : ''
1962 );
1963 }
1964 public function myfixed_element5_content_bg_color_callback()
1965 {
1966 printf(
1967 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options5[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
1968 isset($this->options5['myfixed_element_content_bg_color']) ? esc_attr($this->options5['myfixed_element_content_bg_color']) : ''
1969 );
1970 }
1971 public function myfixed_element5_content_txt_color_callback()
1972 {
1973 printf(
1974 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options5[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
1975 isset($this->options5['myfixed_element_content_txt_color']) ? esc_attr($this->options5['myfixed_element_content_txt_color']) : ''
1976 );
1977 }
1978 public function myfixed_element5_content_width_callback()
1979 {
1980 printf(
1981 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options5[myfixed_element_content_width]" value="%s" />px</p>',
1982 isset($this->options5['myfixed_element_content_width']) ? esc_attr($this->options5['myfixed_element_content_width']) : ''
1983 );
1984 }
1985 public function myfixed_element5_content_padding_callback()
1986 {
1987 printf(
1988 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options5[myfixed_element_content_padding]" value="%s" />px</p>',
1989 isset($this->options5['myfixed_element_content_padding']) ? esc_attr($this->options5['myfixed_element_content_padding']) : ''
1990 );
1991 }
1992
1993
1994 public function myfixed_element5_content_callback()
1995 {
1996 $content_id = 'myfixed_element_content';
1997 $content = (isset($this->options5['myfixed_element_content']) ? esc_textarea($this->options5['myfixed_element_content']) : '');
1998
1999 wp_editor(
2000 html_entity_decode($content),
2001 $content_id,
2002 array(
2003 'textarea_name' => 'mysticky_elements_options5[myfixed_element_content]',
2004 //'teeny' => true,
2005 //'tinymce' => true,
2006 'textarea_rows' => get_option('default_post_edit_rows', 8)
2007 )
2008 );
2009 }
2010
2011
2012
2013
2014 /* ***** ELEMENT 6 ***** */
2015
2016
2017 public function print_section_info4()
2018 {
2019 esc_html_e('Element 6 Settings.', 'mystickyelements');
2020 }
2021
2022
2023 public function myfixed_element4_enable_callback()
2024 {
2025 printf(
2026 '<select id="myfixed_element_enable" name="mysticky_elements_options4[myfixed_element_enable]" selected="%s">',
2027 isset($this->options4['myfixed_element_enable']) ? esc_attr($this->options4['myfixed_element_enable']) : ''
2028 );
2029 if ($this->options4['myfixed_element_enable'] == 'enable') {
2030 printf(
2031 '<option name="enable" value="enable" selected>enable</option>
2032 <option name="disable" value="disable">disable</option>
2033 </select>'
2034 );
2035 }
2036 if ($this->options4['myfixed_element_enable'] == 'disable') {
2037 printf(
2038 '<option name="enable" value="enable">enable</option>
2039 <option name="disable" value="disable" selected >disable</option>
2040 </select>'
2041 );
2042 }
2043 if ($this->options4['myfixed_element_enable'] == '') {
2044 printf(
2045 '<option name="enable" value="enable" >enable</option>
2046 <option name="disable" value="disable" selected >disable</option>
2047 </select>'
2048 );
2049 }
2050 }
2051
2052
2053
2054 public function myfixed_element4_side_position_callback()
2055 {
2056 printf(
2057 '<select id="myfixed_element_side_position" name="mysticky_elements_options4[myfixed_element_side_position]" selected="%s">',
2058 isset($this->options4['myfixed_element_side_position']) ? esc_attr($this->options4['myfixed_element_side_position']) : ''
2059 );
2060 if ($this->options4['myfixed_element_side_position'] == 'left') {
2061 printf(
2062 '<option name="left" value="left" selected>left</option>
2063 <option name="right" value="right">right</option>
2064 </select>'
2065 );
2066 }
2067 if ($this->options4['myfixed_element_side_position'] == 'right') {
2068 printf(
2069 '<option name="left" value="left">left</option>
2070 <option name="right" value="right" selected >right</option>
2071 </select>'
2072 );
2073 }
2074 if ($this->options4['myfixed_element_side_position'] == '') {
2075 printf(
2076 '<option name="left" value="left" selected>left</option>
2077 <option name="right" value="right">right</option>
2078 </select>'
2079 );
2080 }
2081 }
2082 public function myfixed_element4_top_position_callback()
2083 {
2084 printf(
2085 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options4[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
2086 isset($this->options4['myfixed_element_top_position']) ? esc_attr($this->options4['myfixed_element_top_position']) : ''
2087 );
2088 }
2089 public function myfixed_element4_icon_bg_color_callback()
2090 {
2091 printf(
2092 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options4[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
2093 isset($this->options4['myfixed_element_icon_bg_color']) ? esc_attr($this->options4['myfixed_element_icon_bg_color']) : ''
2094 );
2095 }
2096 public function myfixed_element4_icon_bg_img_callback()
2097 {
2098 printf(
2099 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options4[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
2100 isset($this->options4['myfixed_element_icon_bg_img']) ? esc_attr($this->options4['myfixed_element_icon_bg_img']) : ''
2101 );
2102 }
2103 public function myfixed_element4_content_bg_color_callback()
2104 {
2105 printf(
2106 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options4[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
2107 isset($this->options4['myfixed_element_content_bg_color']) ? esc_attr($this->options4['myfixed_element_content_bg_color']) : ''
2108 );
2109 }
2110 public function myfixed_element4_content_txt_color_callback()
2111 {
2112 printf(
2113 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options4[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
2114 isset($this->options4['myfixed_element_content_txt_color']) ? esc_attr($this->options4['myfixed_element_content_txt_color']) : ''
2115 );
2116 }
2117 public function myfixed_element4_content_width_callback()
2118 {
2119 printf(
2120 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options4[myfixed_element_content_width]" value="%s" />px</p>',
2121 isset($this->options4['myfixed_element_content_width']) ? esc_attr($this->options4['myfixed_element_content_width']) : ''
2122 );
2123 }
2124 public function myfixed_element4_content_padding_callback()
2125 {
2126 printf(
2127 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options4[myfixed_element_content_padding]" value="%s" />px</p>',
2128 isset($this->options4['myfixed_element_content_padding']) ? esc_attr($this->options4['myfixed_element_content_padding']) : ''
2129 );
2130 }
2131
2132
2133 public function myfixed_element4_content_callback()
2134 {
2135 $content_id = 'myfixed_element_content';
2136 $content = (isset($this->options4['myfixed_element_content']) ? esc_textarea($this->options4['myfixed_element_content']) : '');
2137
2138 wp_editor(
2139 html_entity_decode($content),
2140 $content_id,
2141 array(
2142 'textarea_name' => 'mysticky_elements_options4[myfixed_element_content]',
2143 //'teeny' => true,
2144 //'tinymce' => true,
2145 'textarea_rows' => get_option('default_post_edit_rows', 8)
2146 )
2147 );
2148 }
2149
2150
2151 /* ***** ELEMENT 7 ***** */
2152
2153
2154 public function print_section_info3()
2155 {
2156 esc_html_e('Element 7 Settings.', 'mystickyelements');
2157 }
2158
2159
2160 public function myfixed_element3_enable_callback()
2161 {
2162 printf(
2163 '<select id="myfixed_element_enable" name="mysticky_elements_options3[myfixed_element_enable]" selected="%s">',
2164 isset($this->options3['myfixed_element_enable']) ? esc_attr($this->options3['myfixed_element_enable']) : ''
2165 );
2166 if ($this->options3['myfixed_element_enable'] == 'enable') {
2167 printf(
2168 '<option name="enable" value="enable" selected>enable</option>
2169 <option name="disable" value="disable">disable</option>
2170 </select>'
2171 );
2172 }
2173 if ($this->options3['myfixed_element_enable'] == 'disable') {
2174 printf(
2175 '<option name="enable" value="enable">enable</option>
2176 <option name="disable" value="disable" selected >disable</option>
2177 </select>'
2178 );
2179 }
2180 if ($this->options3['myfixed_element_enable'] == '') {
2181 printf(
2182 '<option name="enable" value="enable" >enable</option>
2183 <option name="disable" value="disable" selected >disable</option>
2184 </select>'
2185 );
2186 }
2187 }
2188
2189
2190
2191 public function myfixed_element3_side_position_callback()
2192 {
2193 printf(
2194 '<select id="myfixed_element_side_position" name="mysticky_elements_options3[myfixed_element_side_position]" selected="%s">',
2195 isset($this->options3['myfixed_element_side_position']) ? esc_attr($this->options3['myfixed_element_side_position']) : ''
2196 );
2197 if ($this->options3['myfixed_element_side_position'] == 'left') {
2198 printf(
2199 '<option name="left" value="left" selected>left</option>
2200 <option name="right" value="right">right</option>
2201 </select>'
2202 );
2203 }
2204 if ($this->options3['myfixed_element_side_position'] == 'right') {
2205 printf(
2206 '<option name="left" value="left">left</option>
2207 <option name="right" value="right" selected >right</option>
2208 </select>'
2209 );
2210 }
2211 if ($this->options3['myfixed_element_side_position'] == '') {
2212 printf(
2213 '<option name="left" value="left" selected>left</option>
2214 <option name="right" value="right">right</option>
2215 </select>'
2216 );
2217 }
2218 }
2219 public function myfixed_element3_top_position_callback()
2220 {
2221 printf(
2222 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options3[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
2223 isset($this->options3['myfixed_element_top_position']) ? esc_attr($this->options3['myfixed_element_top_position']) : ''
2224 );
2225 }
2226 public function myfixed_element3_icon_bg_color_callback()
2227 {
2228 printf(
2229 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options3[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
2230 isset($this->options3['myfixed_element_icon_bg_color']) ? esc_attr($this->options3['myfixed_element_icon_bg_color']) : ''
2231 );
2232 }
2233 public function myfixed_element3_icon_bg_img_callback()
2234 {
2235 printf(
2236 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options3[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
2237 isset($this->options3['myfixed_element_icon_bg_img']) ? esc_attr($this->options3['myfixed_element_icon_bg_img']) : ''
2238 );
2239 }
2240 public function myfixed_element3_content_bg_color_callback()
2241 {
2242 printf(
2243 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options3[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
2244 isset($this->options3['myfixed_element_content_bg_color']) ? esc_attr($this->options3['myfixed_element_content_bg_color']) : ''
2245 );
2246 }
2247 public function myfixed_element3_content_txt_color_callback()
2248 {
2249 printf(
2250 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options3[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
2251 isset($this->options3['myfixed_element_content_txt_color']) ? esc_attr($this->options3['myfixed_element_content_txt_color']) : ''
2252 );
2253 }
2254 public function myfixed_element3_content_width_callback()
2255 {
2256 printf(
2257 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options3[myfixed_element_content_width]" value="%s" />px</p>',
2258 isset($this->options3['myfixed_element_content_width']) ? esc_attr($this->options3['myfixed_element_content_width']) : ''
2259 );
2260 }
2261 public function myfixed_element3_content_padding_callback()
2262 {
2263 printf(
2264 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options3[myfixed_element_content_padding]" value="%s" />px</p>',
2265 isset($this->options3['myfixed_element_content_padding']) ? esc_attr($this->options3['myfixed_element_content_padding']) : ''
2266 );
2267 }
2268
2269
2270 public function myfixed_element3_content_callback()
2271 {
2272 $content_id = 'myfixed_element_content';
2273 $content = (isset($this->options3['myfixed_element_content']) ? esc_textarea($this->options3['myfixed_element_content']) : '');
2274
2275 wp_editor(
2276 html_entity_decode($content),
2277 $content_id,
2278 array(
2279 'textarea_name' => 'mysticky_elements_options3[myfixed_element_content]',
2280 //'teeny' => true,
2281 //'tinymce' => true,
2282 'textarea_rows' => get_option('default_post_edit_rows', 8)
2283 )
2284 );
2285 }
2286
2287
2288 /* ***** ELEMENT 8 ***** */
2289
2290
2291 public function print_section_info2()
2292 {
2293 esc_html_e('Element 8 Settings.', 'mystickyelements');
2294 }
2295
2296
2297 public function myfixed_element2_enable_callback()
2298 {
2299 printf(
2300 '<select id="myfixed_element_enable" name="mysticky_elements_options2[myfixed_element_enable]" selected="%s">',
2301 isset($this->options2['myfixed_element_enable']) ? esc_attr($this->options2['myfixed_element_enable']) : ''
2302 );
2303 if ($this->options2['myfixed_element_enable'] == 'enable') {
2304 printf(
2305 '<option name="enable" value="enable" selected>enable</option>
2306 <option name="disable" value="disable">disable</option>
2307 </select>'
2308 );
2309 }
2310 if ($this->options2['myfixed_element_enable'] == 'disable') {
2311 printf(
2312 '<option name="enable" value="enable">enable</option>
2313 <option name="disable" value="disable" selected >disable</option>
2314 </select>'
2315 );
2316 }
2317 if ($this->options2['myfixed_element_enable'] == '') {
2318 printf(
2319 '<option name="enable" value="enable" >enable</option>
2320 <option name="disable" value="disable" selected >disable</option>
2321 </select>'
2322 );
2323 }
2324 }
2325
2326
2327
2328 public function myfixed_element2_side_position_callback()
2329 {
2330 printf(
2331 '<select id="myfixed_element_side_position" name="mysticky_elements_options2[myfixed_element_side_position]" selected="%s">',
2332 isset($this->options2['myfixed_element_side_position']) ? esc_attr($this->options2['myfixed_element_side_position']) : ''
2333 );
2334 if ($this->options2['myfixed_element_side_position'] == 'left') {
2335 printf(
2336 '<option name="left" value="left" selected>left</option>
2337 <option name="right" value="right">right</option>
2338 </select>'
2339 );
2340 }
2341 if ($this->options2['myfixed_element_side_position'] == 'right') {
2342 printf(
2343 '<option name="left" value="left">left</option>
2344 <option name="right" value="right" selected >right</option>
2345 </select>'
2346 );
2347 }
2348 if ($this->options2['myfixed_element_side_position'] == '') {
2349 printf(
2350 '<option name="left" value="left" selected>left</option>
2351 <option name="right" value="right">right</option>
2352 </select>'
2353 );
2354 }
2355 }
2356 public function myfixed_element2_top_position_callback()
2357 {
2358 printf(
2359 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options2[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
2360 isset($this->options2['myfixed_element_top_position']) ? esc_attr($this->options2['myfixed_element_top_position']) : ''
2361 );
2362 }
2363 public function myfixed_element2_icon_bg_color_callback()
2364 {
2365 printf(
2366 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options2[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
2367 isset($this->options2['myfixed_element_icon_bg_color']) ? esc_attr($this->options2['myfixed_element_icon_bg_color']) : ''
2368 );
2369 }
2370 public function myfixed_element2_icon_bg_img_callback()
2371 {
2372 printf(
2373 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options2[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
2374 isset($this->options2['myfixed_element_icon_bg_img']) ? esc_attr($this->options2['myfixed_element_icon_bg_img']) : ''
2375 );
2376 }
2377 public function myfixed_element2_content_bg_color_callback()
2378 {
2379 printf(
2380 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options2[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
2381 isset($this->options2['myfixed_element_content_bg_color']) ? esc_attr($this->options2['myfixed_element_content_bg_color']) : ''
2382 );
2383 }
2384 public function myfixed_element2_content_txt_color_callback()
2385 {
2386 printf(
2387 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options2[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
2388 isset($this->options2['myfixed_element_content_txt_color']) ? esc_attr($this->options2['myfixed_element_content_txt_color']) : ''
2389 );
2390 }
2391 public function myfixed_element2_content_width_callback()
2392 {
2393 printf(
2394 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options2[myfixed_element_content_width]" value="%s" />px</p>',
2395 isset($this->options2['myfixed_element_content_width']) ? esc_attr($this->options2['myfixed_element_content_width']) : ''
2396 );
2397 }
2398 public function myfixed_element2_content_padding_callback()
2399 {
2400 printf(
2401 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options2[myfixed_element_content_padding]" value="%s" />px</p>',
2402 isset($this->options2['myfixed_element_content_padding']) ? esc_attr($this->options2['myfixed_element_content_padding']) : ''
2403 );
2404 }
2405
2406
2407 public function myfixed_element2_content_callback()
2408 {
2409 $content_id = 'myfixed_element_content';
2410 $content = (isset($this->options2['myfixed_element_content']) ? esc_textarea($this->options2['myfixed_element_content']) : '');
2411
2412 wp_editor(
2413 html_entity_decode($content),
2414 $content_id,
2415 array(
2416 'textarea_name' => 'mysticky_elements_options2[myfixed_element_content]',
2417 //'teeny' => true,
2418 //'tinymce' => true,
2419 'textarea_rows' => get_option('default_post_edit_rows', 8)
2420 )
2421 );
2422 }
2423
2424
2425
2426
2427 /* ***** ELEMENT 9 ***** */
2428
2429
2430 public function print_section_info1()
2431 {
2432 esc_html_e('Element 9 Settings.', 'mystickyelements');
2433 }
2434
2435
2436 public function myfixed_element1_enable_callback()
2437 {
2438 printf(
2439 '<select id="myfixed_element_enable" name="mysticky_elements_options1[myfixed_element_enable]" selected="%s">',
2440 isset($this->options1['myfixed_element_enable']) ? esc_attr($this->options1['myfixed_element_enable']) : ''
2441 );
2442 if ($this->options1['myfixed_element_enable'] == 'enable') {
2443 printf(
2444 '<option name="enable" value="enable" selected>enable</option>
2445 <option name="disable" value="disable">disable</option>
2446 </select>'
2447 );
2448 }
2449 if ($this->options1['myfixed_element_enable'] == 'disable') {
2450 printf(
2451 '<option name="enable" value="enable">enable</option>
2452 <option name="disable" value="disable" selected >disable</option>
2453 </select>'
2454 );
2455 }
2456 if ($this->options1['myfixed_element_enable'] == '') {
2457 printf(
2458 '<option name="enable" value="enable" >enable</option>
2459 <option name="disable" value="disable" selected >disable</option>
2460 </select>'
2461 );
2462 }
2463 }
2464
2465
2466
2467 public function myfixed_element1_side_position_callback()
2468 {
2469 printf(
2470 '<select id="myfixed_element_side_position" name="mysticky_elements_options1[myfixed_element_side_position]" selected="%s">',
2471 isset($this->options1['myfixed_element_side_position']) ? esc_attr($this->options1['myfixed_element_side_position']) : ''
2472 );
2473 if ($this->options1['myfixed_element_side_position'] == 'left') {
2474 printf(
2475 '<option name="left" value="left" selected>left</option>
2476 <option name="right" value="right">right</option>
2477 </select>'
2478 );
2479 }
2480 if ($this->options1['myfixed_element_side_position'] == 'right') {
2481 printf(
2482 '<option name="left" value="left">left</option>
2483 <option name="right" value="right" selected >right</option>
2484 </select>'
2485 );
2486 }
2487 if ($this->options1['myfixed_element_side_position'] == '') {
2488 printf(
2489 '<option name="left" value="left" selected>left</option>
2490 <option name="right" value="right">right</option>
2491 </select>'
2492 );
2493 }
2494 }
2495 public function myfixed_element1_top_position_callback()
2496 {
2497 printf(
2498 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options1[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
2499 isset($this->options1['myfixed_element_top_position']) ? esc_attr($this->options1['myfixed_element_top_position']) : ''
2500 );
2501 }
2502 public function myfixed_element1_icon_bg_color_callback()
2503 {
2504 printf(
2505 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options1[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
2506 isset($this->options1['myfixed_element_icon_bg_color']) ? esc_attr($this->options1['myfixed_element_icon_bg_color']) : ''
2507 );
2508 }
2509 public function myfixed_element1_icon_bg_img_callback()
2510 {
2511 printf(
2512 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options1[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
2513 isset($this->options1['myfixed_element_icon_bg_img']) ? esc_attr($this->options1['myfixed_element_icon_bg_img']) : ''
2514 );
2515 }
2516 public function myfixed_element1_content_bg_color_callback()
2517 {
2518 printf(
2519 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options1[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
2520 isset($this->options1['myfixed_element_content_bg_color']) ? esc_attr($this->options1['myfixed_element_content_bg_color']) : ''
2521 );
2522 }
2523 public function myfixed_element1_content_txt_color_callback()
2524 {
2525 printf(
2526 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options1[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
2527 isset($this->options1['myfixed_element_content_txt_color']) ? esc_attr($this->options1['myfixed_element_content_txt_color']) : ''
2528 );
2529 }
2530 public function myfixed_element1_content_width_callback()
2531 {
2532 printf(
2533 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options1[myfixed_element_content_width]" value="%s" />px</p>',
2534 isset($this->options1['myfixed_element_content_width']) ? esc_attr($this->options1['myfixed_element_content_width']) : ''
2535 );
2536 }
2537 public function myfixed_element1_content_padding_callback()
2538 {
2539 printf(
2540 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options1[myfixed_element_content_padding]" value="%s" />px</p>',
2541 isset($this->options1['myfixed_element_content_padding']) ? esc_attr($this->options1['myfixed_element_content_padding']) : ''
2542 );
2543 }
2544
2545
2546 public function myfixed_element1_content_callback()
2547 {
2548 $content_id = 'myfixed_element_content';
2549 $content = (isset($this->options1['myfixed_element_content']) ? esc_textarea($this->options1['myfixed_element_content']) : '');
2550
2551 wp_editor(
2552 html_entity_decode($content),
2553 $content_id,
2554 array(
2555 'textarea_name' => 'mysticky_elements_options1[myfixed_element_content]',
2556 //'teeny' => true,
2557 //'tinymce' => true,
2558 'textarea_rows' => get_option('default_post_edit_rows', 8)
2559 )
2560 );
2561 }
2562
2563
2564
2565 /* ***** ELEMENT 10 ***** */
2566
2567
2568 public function print_section_info0()
2569 {
2570 esc_html_e('Element 10 Settings.', 'mystickyelements');
2571 }
2572
2573
2574 public function myfixed_element0_enable_callback()
2575 {
2576 printf(
2577 '<select id="myfixed_element_enable" name="mysticky_elements_options0[myfixed_element_enable]" selected="%s">',
2578 isset($this->options0['myfixed_element_enable']) ? esc_attr($this->options0['myfixed_element_enable']) : ''
2579 );
2580 if ($this->options0['myfixed_element_enable'] == 'enable') {
2581 printf(
2582 '<option name="enable" value="enable" selected>enable</option>
2583 <option name="disable" value="disable">disable</option>
2584 </select>'
2585 );
2586 }
2587 if ($this->options0['myfixed_element_enable'] == 'disable') {
2588 printf(
2589 '<option name="enable" value="enable">enable</option>
2590 <option name="disable" value="disable" selected >disable</option>
2591 </select>'
2592 );
2593 }
2594 if ($this->options0['myfixed_element_enable'] == '') {
2595 printf(
2596 '<option name="enable" value="enable" >enable</option>
2597 <option name="disable" value="disable" selected >disable</option>
2598 </select>'
2599 );
2600 }
2601 }
2602
2603
2604
2605 public function myfixed_element0_side_position_callback()
2606 {
2607 printf(
2608 '<select id="myfixed_element_side_position" name="mysticky_elements_options0[myfixed_element_side_position]" selected="%s">',
2609 isset($this->options0['myfixed_element_side_position']) ? esc_attr($this->options0['myfixed_element_side_position']) : ''
2610 );
2611 if ($this->options0['myfixed_element_side_position'] == 'left') {
2612 printf(
2613 '<option name="left" value="left" selected>left</option>
2614 <option name="right" value="right">right</option>
2615 </select>'
2616 );
2617 }
2618 if ($this->options0['myfixed_element_side_position'] == 'right') {
2619 printf(
2620 '<option name="left" value="left">left</option>
2621 <option name="right" value="right" selected >right</option>
2622 </select>'
2623 );
2624 }
2625 if ($this->options0['myfixed_element_side_position'] == '') {
2626 printf(
2627 '<option name="left" value="left" selected>left</option>
2628 <option name="right" value="right">right</option>
2629 </select>'
2630 );
2631 }
2632 }
2633 public function myfixed_element0_top_position_callback()
2634 {
2635 printf(
2636 '<p class="description"><input type="text" size="4" id="myfixed_element_top_position" name="mysticky_elements_options0[myfixed_element_top_position]" value="%s" /> px (top position of an element). Please note that Element 1 must be on top of element 2 and so on, otherwise elements will overlap...</p>',
2637 isset($this->options0['myfixed_element_top_position']) ? esc_attr($this->options0['myfixed_element_top_position']) : ''
2638 );
2639 }
2640 public function myfixed_element0_icon_bg_color_callback()
2641 {
2642 printf(
2643 '<p class="description"><input type="text" size="8" id="myfixed_element_icon_bg_color" name="mysticky_elements_options0[myfixed_element_icon_bg_color]" value="%s" class="my-color-field" /></p>',
2644 isset($this->options0['myfixed_element_icon_bg_color']) ? esc_attr($this->options0['myfixed_element_icon_bg_color']) : ''
2645 );
2646 }
2647 public function myfixed_element0_icon_bg_img_callback()
2648 {
2649 printf(
2650 '<p class="description"><input type="text" size="28" id="myfixed_element_icon_bg_img" name="mysticky_elements_options0[myfixed_element_icon_bg_img]" value="%s" /> Icon Image.</p>',
2651 isset($this->options0['myfixed_element_icon_bg_img']) ? esc_attr($this->options0['myfixed_element_icon_bg_img']) : ''
2652 );
2653 }
2654 public function myfixed_element0_content_bg_color_callback()
2655 {
2656 printf(
2657 '<p class="description"><input type="text" size="8" id="myfixed_element_content_bg_color" name="mysticky_elements_options0[myfixed_element_content_bg_color]" value="%s" class="my-color-field" /></p>',
2658 isset($this->options0['myfixed_element_content_bg_color']) ? esc_attr($this->options0['myfixed_element_content_bg_color']) : ''
2659 );
2660 }
2661 public function myfixed_element0_content_txt_color_callback()
2662 {
2663 printf(
2664 '<p class="description"><input type="text" size="8" id="myfixed_element_content_txt_color" name="mysticky_elements_options0[myfixed_element_content_txt_color]" value="%s" class="my-color-field" /></p>',
2665 isset($this->options0['myfixed_element_content_txt_color']) ? esc_attr($this->options0['myfixed_element_content_txt_color']) : ''
2666 );
2667 }
2668 public function myfixed_element0_content_width_callback()
2669 {
2670 printf(
2671 '<p class="description"><input type="text" size="4" id="myfixed_element_content_width" name="mysticky_elements_options0[myfixed_element_content_width]" value="%s" />px</p>',
2672 isset($this->options0['myfixed_element_content_width']) ? esc_attr($this->options0['myfixed_element_content_width']) : ''
2673 );
2674 }
2675 public function myfixed_element0_content_padding_callback()
2676 {
2677 printf(
2678 '<p class="description"><input type="text" size="4" id="myfixed_element_content_padding" name="mysticky_elements_options0[myfixed_element_content_padding]" value="%s" />px</p>',
2679 isset($this->options0['myfixed_element_content_padding']) ? esc_attr($this->options0['myfixed_element_content_padding']) : ''
2680 );
2681 }
2682
2683
2684 public function myfixed_element0_content_callback()
2685 {
2686 $content_id = 'myfixed_element_content';
2687 $content = (isset($this->options0['myfixed_element_content']) ? esc_textarea($this->options0['myfixed_element_content']) : '');
2688
2689 wp_editor(
2690 html_entity_decode($content),
2691 $content_id,
2692 array(
2693 'textarea_name' => 'mysticky_elements_options0[myfixed_element_content]',
2694 //'teeny' => true,
2695 //'tinymce' => true,
2696 'textarea_rows' => get_option('default_post_edit_rows', 8)
2697 )
2698 );
2699 }
2700
2701
2702
2703
2704
2705
2706
2707 }
2708
2709
2710 // end plugin admin settings
2711
2712
2713
2714
2715
2716 // Create style from options
2717
2718 function mysticky_element_build_stylesheet_content()
2719 {
2720
2721 $mysticky_options = get_option('mysticky_elements_options');
2722
2723
2724 echo
2725 '<style type="text/css">';
2726 if ($mysticky_options['myfixed_cssstyle'] == "") {
2727 echo '';
2728 }
2729 echo
2730 $mysticky_options ['myfixed_cssstyle'] ;
2731
2732 if ($mysticky_options ['myfixed_disable_small_screen'] > 0) {
2733 echo
2734 '
2735 @media only screen and (max-width: ' . esc_attr($mysticky_options ['myfixed_disable_small_screen']) . 'px) { .mysticky-block-left, .mysticky-block-right { display: none; } }
2736 ';
2737
2738 }
2739 echo
2740 '</style>
2741 ';
2742 }
2743
2744
2745
2746
2747 function insert_my_footerrr()
2748 {
2749
2750 $mysticky_options0 = get_option('mysticky_elements_options0');
2751 $mysticky_options1 = get_option('mysticky_elements_options1');
2752 $mysticky_options2 = get_option('mysticky_elements_options2');
2753 $mysticky_options3 = get_option('mysticky_elements_options3');
2754 $mysticky_options4 = get_option('mysticky_elements_options4');
2755 $mysticky_options5 = get_option('mysticky_elements_options5');
2756 $mysticky_options6 = get_option('mysticky_elements_options6');
2757 $mysticky_options7 = get_option('mysticky_elements_options7');
2758 $mysticky_options8 = get_option('mysticky_elements_options8');
2759 $mysticky_options9 = get_option('mysticky_elements_options9');
2760
2761 $mysticky_options_arr = array($mysticky_options0, $mysticky_options1, $mysticky_options2, $mysticky_options3, $mysticky_options4, $mysticky_options5, $mysticky_options6, $mysticky_options7, $mysticky_options8, $mysticky_options9);
2762
2763 foreach ($mysticky_options_arr as &$mysticky_option) {
2764
2765 //$mysticky_option
2766 if ($mysticky_option ['myfixed_element_enable'] == "enable") {
2767
2768 $plugins_url = plugins_url();
2769
2770 echo '
2771 <div class="mysticky-block-' . esc_attr($mysticky_option ['myfixed_element_side_position']) . '" style="width: ' . esc_attr($mysticky_option ['myfixed_element_content_width']) . 'px; ' . esc_attr($mysticky_option ['myfixed_element_side_position']) . ': -' . esc_attr($mysticky_option ['myfixed_element_content_width']) . 'px; top: ' . esc_attr($mysticky_option ['myfixed_element_top_position']) . 'px; position: fixed; background:' . esc_attr($mysticky_option ['myfixed_element_content_bg_color']) . ';">
2772 <div class="mysticky-block-icon" style="background-color:' . esc_attr($mysticky_option ['myfixed_element_icon_bg_color']) . '; background-image: url(' . plugins_url(''. esc_attr($mysticky_option ['myfixed_element_icon_bg_img']) . '', __FILE__) . ');"></div>
2773 <div class="mysticky-block-content" style="min-height: 50px; color:' . esc_attr($mysticky_option ['myfixed_element_content_txt_color']) . '; padding: ' . esc_attr($mysticky_option ['myfixed_element_content_padding']) . 'px;">' . do_shortcode($mysticky_option ['myfixed_element_content']) . '</div>
2774
2775 </div>
2776 ';
2777 }; // endif
2778
2779
2780 if ($mysticky_option ['myfixed_element_enable'] == "disable") {
2781
2782 echo '';
2783 }; // endif
2784
2785
2786 }
2787
2788 unset($mysticky_options_arr); // break the reference with the last element
2789
2790 }
2791
2792
2793
2794 function mystickyelements_script()
2795 {
2796
2797 $mysticky_options = get_option('mysticky_elements_options');
2798
2799 if (wp_script_is('jquery')) {
2800 // do nothing
2801 } else {
2802 wp_enqueue_script('jquery');
2803 }
2804 //wp_enqueue_script( 'mystickyelements', 'https://code.jquery.com/jquery-3.5.0.js',false,'1.0.0', true );
2805 wp_register_script('mystickyelements', plugins_url('dist/js/mystickyelements.js', __FILE__), false, MY_STICKY_ELEMENT_VERSION, true);
2806 wp_enqueue_script('mystickyelements');
2807
2808 // Localize mystickyelements.js script with myStickyElements options
2809 $mysticky_translation_array = array(
2810 'myfixed_click_string' => $mysticky_options['myfixed_click'] ,
2811 /* 'mysticky_active_on_height_string' => $mysticky_options['mysticky_active_on_height'],*/
2812 'mysticky_disable_at_width_string' => $mysticky_options['myfixed_disable_small_screen'],
2813
2814 );
2815
2816 wp_localize_script('mystickyelements', 'mysticky_element', $mysticky_translation_array);
2817 }
2818
2819
2820
2821
2822 if (!function_exists('mystickyelement_activate')) {
2823 function mystickyelement_activate()
2824 {
2825 global $wpdb;
2826 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
2827 $charset_collate = $wpdb->get_charset_collate();
2828
2829 $contact_lists_table = $wpdb->prefix . 'mystickyelement_contact_lists';
2830 if ($wpdb->get_var("show tables like '$contact_lists_table'") != $contact_lists_table) {
2831
2832 $contact_lists_table_sql = "CREATE TABLE $contact_lists_table (
2833 ID int(11) NOT NULL AUTO_INCREMENT,
2834 contact_name varchar(255) NULL,
2835 contact_phone varchar(255) NULL,
2836 contact_email varchar(255) NULL,
2837 contact_message text NULL,
2838 contact_option varchar(255) NULL,
2839 message_date DATETIME NOT NULL default '0000-00-00 00:00:00',
2840 PRIMARY KEY (ID)
2841 ) $charset_collate;";
2842 dbDelta($contact_lists_table_sql);
2843 }
2844
2845 if (get_option('mystickyelements-contact-form') == false) {
2846 $contact_form = array(
2847 'enable' => 1,
2848 'name' => 1,
2849 'name_require' => '',
2850 'name_value' => '',
2851 'phone' => 1,
2852 'phone_require' => 1,
2853 'phone_value' => '',
2854 'email' => 1,
2855 'email_require' => 1,
2856 'email_value' => '',
2857 'message' => 1,
2858 'message_value' => '',
2859 'dropdown' => '',
2860 'dropdown_require' => '',
2861 'submit_button_background_color' => '#7761DF',
2862 'submit_button_text_color' => '#FFFFFF',
2863 'submit_button_text' => 'Submit',
2864 'desktop' => 1,
2865 'mobile' => 1,
2866 'direction' => 'LTR',
2867 'tab_background_color' => '#7761DF',
2868 'tab_text_color' => '#FFFFFF',
2869 'headine_text_color' => '#7761DF',
2870 'text_in_tab' => 'Contact Us',
2871 'send_leads' => 'database',
2872 'sent_to_mail' => '',
2873 'form_css' => '' ,
2874 'contact_title_text' => 'Contact Form',
2875 );
2876
2877 //update_option( 'mystickyelements-contact-form', $contact_form);
2878 }
2879
2880 if (get_option('mystickyelements-social-channels') == false) {
2881 $social_channels = array(
2882 'enable' => 1,
2883 'whatsapp' => 1,
2884 //'facebook_messenger'=> 1,
2885 );
2886
2887 //update_option( 'mystickyelements-social-channels', $social_channels);
2888 }
2889 if (get_option('mystickyelements-social-channels-tabs') == false) {
2890 $social_channels_tabs['whatsapp'] = array(
2891 'text' => "",
2892 'hover_text' => "WhatsApp",
2893 'bg_color' => "#26D367",
2894 'desktop' => 1,
2895 'mobile' => 1,
2896 );
2897 /*
2898 $social_channels_tabs['facebook_messenger'] = array(
2899 'text' => "",
2900 'hover_text' => "Facebook Messenger",
2901 'bg_color' => "#007FF7",
2902 'desktop' => 1,
2903 'mobile' => 1,
2904 );
2905 */
2906 //update_option( 'mystickyelements-social-channels-tabs', $social_channels_tabs);
2907 }
2908
2909 if (get_option('mystickyelements-general-settings') == false) {
2910 $general_settings = array(
2911 'position' => 'left',
2912 'position_mobile' => 'left',
2913 'open_tabs_when' => 'hover',
2914 'mobile_behavior' => 'disable',
2915 'flyout' => 'disable',
2916 'custom_position' => '',
2917 'tabs_css' => '',
2918 'minimize_tab' => '1',
2919 'on_load_when' => 'open',
2920 'minimize_tab_background_color' => '#000000',
2921 'page_settings' => '',
2922 'placeholder_color' => '#4F4F4F',
2923 );
2924
2925 //update_option( 'mystickyelements-general-settings', $general_settings);
2926 }
2927
2928 $mystickyelements_popup_status = get_option('mystickyelements_intro_popup');
2929 if (($mystickyelements_popup_status === false || empty($mystickyelements_popup_status)) && !isset($_GET['update_version'])) {
2930 add_option('mystickyelements_intro_popup', 'show');
2931 }
2932
2933 update_option('mystickyelements-update_2_0', true);
2934 }
2935 }
2936
2937 register_activation_hook(__FILE__, 'mystickyelement_activate');
2938
2939
2940 if (!function_exists('mystickyelements_social_channels')) {
2941
2942 function mystickyelements_social_channels()
2943 {
2944 $social_channels = array(
2945 'whatsapp' => array(
2946 'text' => "WhatsApp",
2947 'icon_text' => "",
2948 'hover_text' => "WhatsApp",
2949 'background_color' => "#26D367",
2950 'placeholder' => 'Example: +18006927753',
2951 'class' => "fab fa-whatsapp",
2952 'tooltip' => 'Add your full WhatsApp number with country code. E.g., +18006927753',
2953 'is_pre_set_message' => 1,
2954 'use_whatsapp_web' => 1,
2955 'number_validation' => 1,
2956 'icon_color' => 1
2957 ),
2958 'facebook_messenger' => array(
2959 'text' => "Facebook Messenger",
2960 'icon_text' => "",
2961 'hover_text' => "Facebook Messenger",
2962 'background_color' => "#0365FE",
2963 'placeholder' => 'Example: Coca-Cola',
2964 'class' => "fab fa-facebook-messenger",
2965 'tooltip' => '<ul><li>1. Go to <a href="" target="_blank">Facebook.com</a></li><li>2. Click on your name tab</li><li>3. Copy the last part of the URL <img src="'.MYSTICKYELEMENTS_URL.'images/facebook-image.png" /></li><li>4. Add your Messenger username. If your page\'s username is "cocacola" add only the username part. E.g., cocacola</li></ul>',
2966 'icon_color' => 1
2967 ),
2968 'facebook' => array(
2969 'text' => "Facebook",
2970 'icon_text' => "",
2971 'hover_text' => "Facebook",
2972 'background_color' => "#4267B2",
2973 'placeholder' => 'Example: https://facebook.com/coca-cola/',
2974 'class' => "fab fa-facebook-f",
2975 'tooltip' => 'Add the link of of your Facebook page or URL. E.g., <a href="https://facebook.com/cocacola" target="_blank">https://facebook.com/cocacola</a>',
2976 'icon_color' => 1
2977 ),
2978 'SMS' => array(
2979 'text' => "SMS",
2980 'icon_text' => "",
2981 'hover_text' => "SMS",
2982 'background_color' => "#ff549c",
2983 'placeholder' => 'Example: +1507854875',
2984 'class' => "fas fa-sms",
2985 'tooltip' => 'Add your full phone number with country code. E.g., +18006927753',
2986 'number_validation' => 1,
2987 'is_pre_set_message' => 1,
2988 'icon_color' => 1
2989 ),
2990 'phone' => array(
2991 'text' => "Phone",
2992 'icon_text' => "",
2993 'hover_text' => "Phone",
2994 'background_color' => "#26D37C",
2995 'placeholder' => 'Example: +18006927753',
2996 'class' => "fa fa-phone",
2997 'tooltip' => 'Add your full phone number with country code. E.g., +18006927753',
2998 'number_validation' => 1,
2999 'icon_color' => 1
3000 ),
3001 'email' => array(
3002 'text' => "Email",
3003 'icon_text' => "",
3004 'hover_text' => "Email",
3005 'background_color' => "#DC483C",
3006 'placeholder' => 'Example: john@example.com',
3007 'class' => "far fa-envelope",
3008 'tooltip' => 'Add your email address. E.g., support@premio.io',
3009 'is_pre_set_message' => 1,
3010 'icon_color' => 1
3011 ),
3012 'insagram' => array(
3013 'text' => "Instagram Page",
3014 'icon_text' => "",
3015 'hover_text' => "Instagram Page",
3016 'background_color' => "",
3017 'placeholder' => 'Example: https://instagram.com/cocacola',
3018 'class' => "fab fa-instagram",
3019 'tooltip' => 'Add the link of of your Instagram profile E.g., <a href="https://instagram.com/cocacola" target="_blank">https://instagram.com/cocacola</a>',
3020 'icon_color' => 1
3021 ),
3022 'insagram_dm' => [
3023 'text' => "Instagram DM",
3024 'icon_text' => "",
3025 'hover_text' => "Instagram DM",
3026 'background_color' => "",
3027 'placeholder' => 'Instagram DM Example: Instagram_handle',
3028 'channel_class' => 'social-insagram',
3029 'class' => "mystickyelement_insagramdm_icon",
3030 'tooltip' => 'Add the link to your Instagram profile, e.g. <a href="https://instagram.com/cocacola" target="_blank">https://instagram.com/cocacola</a> or directly add the Instagram handle, e.g. cocacola',
3031 'custom_svg_icon' => file_get_contents(MYSTICKYELEMENTS_PATH.'/images/instagramdm-logo.svg'),
3032 'icon_color' => 1,
3033 ],
3034 'threads' => [
3035 'text' => "Threads",
3036 'icon_text' => "",
3037 'hover_text' => "Threads",
3038 'background_color' => "#000000",
3039 'placeholder' => 'Example: https://www.threads.net/@demo_link',
3040 'class' => "fa-brands fa-threads",
3041 'tooltip' => 'Add a link to your Threads profile here. For example: <a href="https://www.threads.net/@demo_link" target="_blank">https://www.threads.net/@demo_link</a>',
3042 'icon_color' => 1,
3043 ],
3044 'telegram' => array(
3045 'text' => "Telegram",
3046 'icon_text' => "",
3047 'hover_text' => "Telegram",
3048 'background_color' => "#2CA5E0",
3049 'placeholder' => 'Enter Telegram username of channel or personal profile',
3050 'class' => "fab fa-telegram-plane",
3051 'tooltip' => 'Enter the username of your Telegram profile or channel. You can find your username by going into the Telegram profile. E.g., TelegramTips',
3052 'icon_color' => 1
3053 ),
3054 'address' => array(
3055 'text' => "Address",
3056 'icon_text' => "",
3057 'icon_label' => "Address",
3058 'icon_new_tab' => "0",
3059 'hover_text' => "Address",
3060 'background_color' => "#23D28C",
3061 'placeholder' => 'Example: 3229, Royalway, Houston, TX 77058, US',
3062 'class' => "fas fa-map-marker-alt",
3063 'tooltip' => 'Add your full address. E.g., 3229, Royalway, Houston, TX 77058, US',
3064 'icon_color' => 1
3065 ),
3066 'business_hours' => array(
3067 'text' => "Open Hours",
3068 'icon_text' => "",
3069 'icon_label' => "Opening Hours",
3070 'icon_new_tab' => "0",
3071 'hover_text' => "Open Hours",
3072 'background_color' => "#E85F65",
3073 'placeholder' => 'Example: 9:00 - 5:00',
3074 'class' => "fas fa-calendar-alt",
3075 'tooltip' => 'Write your opening hours. E.g, 9:00am - 5:00pm or 9:00 - 5:00 or 9:00 - 15:30',
3076 'icon_color' => 1
3077 ),
3078 'youtube' => array(
3079 'text' => "YouTube",
3080 'icon_text' => "",
3081 'hover_text' => "YouTube",
3082 'background_color' => "#F54E4E",
3083 'placeholder' => 'Example: https://youtube.com/username',
3084 'class' => "fab fa-youtube",
3085 'tooltip' => 'Add your YouTube channel link. E.g., <a href="https://youtube.com/username" target="_blank">https://youtube.com/username</a>',
3086 'icon_color' => 1
3087 ),
3088 'poptin_popups' => array(
3089 'text' => "Poptin Popups",
3090 'icon_text' => "",
3091 "icon_label" => "Popup link",
3092 'hover_text' => "Poptin Popups",
3093 'background_color' => "#47a2b1",
3094 'placeholder' => 'Example: https://app.popt.in/APIRequest/click/96Y4a02XXa15e',
3095 'class' => "mystickyelement_poptin_icon",
3096 'tooltip' => 'Copy your Poptin popup link from "On-click", from Display Rules. Check the <a href="https://premio.io/help/mystickyelements/how-to-launch-a-poptin-pop-up-in-my-sticky-elements/" target="_blank">documentation</a> for more. E.g., <a href="https://app.popt.in/APIRequest/click/96Y4a02XXa15e" target="_blank">https://app.popt.in/APIRequest/click/96Y4a02XXa15e</a>',
3097 'icon_color' => 1
3098 ),
3099 'wechat' => array(
3100 'text' => "WeChat",
3101 'icon_text' => "",
3102 'hover_text' => "WeChat",
3103 'background_color' => "#00AD19",
3104 'placeholder' => 'Enter weChat ID. E.g., cocacola',
3105 'class' => "fab fa-weixin",
3106 'tooltip' => "Enter the weChat ID of the profile you want to add. You will usually find the 'WeChat ID' written next to the avatar photo of the profile.Unfortunately, WeChat doesn't have a click-to-chat API, therefore we can only show your username on-click so visitors can look-up for it",
3107 'icon_color' => 1
3108 ),
3109 'snapchat' => array(
3110 'text' => "Snapchat",
3111 'icon_text' => "",
3112 'hover_text' => "Snapchat",
3113 'background_color' => "#fffc00",
3114 'placeholder' => 'Example: Enter your Snapchat Username',
3115 'class' => "fab fa-snapchat-ghost",
3116 'tooltip' => 'Enter your Snapchat username. E.g., snapchat_username',
3117 'icon_color' => 1
3118 ),
3119
3120 'twitter' => array(
3121 'text' => "X",
3122 'icon_text' => "",
3123 'hover_text' => "X",
3124 'search_class' => "X",
3125 'background_color' => "#000000",
3126 'placeholder' => 'Example: https://x.com/cocacola',
3127 'class' => "fa-brands fa-x-twitter",
3128 'tooltip' => 'Add the link of your X profile E.g., <a href="https://x.com/cocacola" target="_blank">https://x.com/cocacola</a>',
3129 'icon_color' => 1
3130 ),
3131 'linkedin' => array(
3132 'text' => "LinkedIn",
3133 'icon_text' => "",
3134 'hover_text' => "LinkedIn",
3135 'background_color' => "#0077b5",
3136 'placeholder' => 'Example: https://linkedin.com/in/username',
3137 'class' => "fab fa-linkedin-in",
3138 'tooltip' => 'Enter the full link of your LinkedIn profile. E.g., <a href="https://linkedin.com/in/username" target="_blank">https://linkedin.com/in/username</a>',
3139 'icon_color' => 1
3140 ),
3141 'viber' => array(
3142 'text' => "Viber",
3143 'icon_text' => "",
3144 'hover_text' => "Viber",
3145 'background_color' => "#59267c",
3146 'placeholder' => 'Example: +1507854875',
3147 'class' => "fab fa-viber",
3148 'tooltip' => 'Enter your full phone number that you registered with Viber. E.g., +1507854875',
3149 'number_validation' => 1,
3150 'icon_color' => 1
3151 ),
3152 'tiktok' => array(
3153 'text' => "TikTok",
3154 'icon_text' => "",
3155 'hover_text' => "TikTok",
3156 'background_color' => "#000",
3157 'placeholder' => 'Example: @TikTok_username',
3158 'class' => "fab fa-tiktok",
3159 'tooltip' => '',
3160 'icon_color' => 1
3161 ),
3162 'vimeo' => array(
3163 'text' => "Vimeo",
3164 'icon_text' => "",
3165 'hover_text' => "Vimeo",
3166 'background_color' => "#1ab7ea",
3167 'placeholder' => 'Example: https://vimeo.com/channel-name',
3168 'class' => "fab fa-vimeo-v",
3169 'tooltip' => 'Add your Vimeo channel link. E.g., <a href="https://vimeo.com/channel-name" target="_blank">https://vimeo.com/channel-name</a>',
3170 'icon_color' => 1,
3171 ),
3172 'pinterest' => array(
3173 'text' => "Pinterest",
3174 'icon_text' => "",
3175 'hover_text' => "Pinterest",
3176 'background_color' => "#E85F65",
3177 'placeholder' => 'Example: https://pinterest.com/username',
3178 'class' => "fab fa-pinterest-p",
3179 'tooltip' => 'Add the link of of your Pinterest profile E.g., <a href="https://pinterest.com/username" target="_blank">https://pinterest.com/username</a>',
3180 'icon_color' => 1
3181 ),
3182 'line' => array(
3183 'text' => "Line",
3184 'icon_text' => "",
3185 'hover_text' => "Line",
3186 'background_color' => "#00c300",
3187 'placeholder' => 'Example: http://line.me/ti/p/2a-s5A2B8B',
3188 'class' => "mystickyelement_line_icon",
3189 'tooltip' => 'Add your full profile link of Line. E.g., <a href="http://line.me/ti/p/2a-s5A2B8B" target="_blank">http://line.me/ti/p/2a-s5A2B8B</a>',
3190 'icon_color' => 1,
3191 'custom_svg_icon' => file_get_contents(MYSTICKYELEMENTS_PATH . '/images/line-logo.svg')
3192 ),
3193 'itunes' => array(
3194 'text' => "iTunes",
3195 'icon_text' => "",
3196 'hover_text' => "iTunes",
3197 'background_color' => "#495057",
3198 'placeholder' => 'Example: https://www.apple.com/us/itunes/channel-link',
3199 'class' => "fab fa-itunes-note",
3200 'tooltip' => 'Add your iTunes channel link. E.g., <a href="https://www.apple.com/us/itunes/channel-link" target="_blank">https://www.apple.com/us/itunes/channel-link</a>',
3201 'icon_color' => 1
3202 ),
3203 'SoundCloud' => array(
3204 'text' => "SoundCloud",
3205 'icon_text' => "",
3206 'hover_text' => "SoundCloud",
3207 'background_color' => "#ff5500",
3208 'placeholder' => 'Example: https://soundcloud.com/channel-link',
3209 'class' => "fab fa-soundcloud",
3210 'tooltip' => 'Add your SoundCloud channel link. E.g., <a href="https://soundcloud.com/channel-link" target="_blank">https://soundcloud.com/channel-link</a>',
3211 'icon_color' => 1
3212 ),
3213 'vk' => array(
3214 'text' => "Vkontakte",
3215 'icon_text' => "",
3216 'hover_text' => "Vkontakte",
3217 'background_color' => "#4a76a8",
3218 'placeholder' => 'Enter your Vk username. If "vk.com/example" is the URL, username is "example"',
3219 'class' => "fab fa-vk",
3220 'tooltip' => 'Username for the VK account part of the web page address, for "vk.com/example" the username is "example". Only enter the username',
3221 'icon_color' => 1
3222 ),
3223 'spotify' => array(
3224 'text' => "Spotify",
3225 'icon_text' => "",
3226 'hover_text' => "Spotify",
3227 'background_color' => "#ff5500",
3228 'placeholder' => 'Example: https://www.spotify.com/channel-link',
3229 'class' => "fab fa-spotify",
3230 'tooltip' => 'Add your Spotify channel link. E.g., <a href="https://www.spotify.com/channel-link" target="_blank">https://www.spotify.com/channel-link</a>',
3231 'icon_color' => 1
3232 ),
3233 'tumblr' => array(
3234 'text' => "Tumblr",
3235 'icon_text' => "",
3236 'hover_text' => "Tumblr",
3237 'background_color' => "#35465d",
3238 'placeholder' => 'Example: https://www.tumblr.com/channel-link',
3239 'class' => "fab fa-tumblr",
3240 'tooltip' => 'Add your full profile link of Tumblr. E.g, <a href="https://www.tumblr.com/channel-link" target="_blank">https://www.tumblr.com/channel-link</a>',
3241 'icon_color' => 1
3242 ),
3243 'qzone' => array(
3244 'text' => "Qzone",
3245 'icon_text' => "",
3246 'hover_text' => "Qzone",
3247 'background_color' => "#1a87da",
3248 'placeholder' => 'Example: https://qzone.qq.com/channel-link',
3249 'class' => "mystickyelement_qzone_icon",
3250 'tooltip' => 'Add your full profile link of Qzone. E.g, <a href="https://qzone.qq.com/channel-link" target="_blank">https://qzone.qq.com/channel-link</a>',
3251 'icon_color' => 1,
3252 'custom_svg_icon' => file_get_contents(MYSTICKYELEMENTS_PATH . '/images/qzone-logo.svg')
3253 ),
3254 'qq' => array(
3255 'text' => "QQ",
3256 'icon_text' => "",
3257 'hover_text' => "QQ",
3258 'background_color' => "#212529",
3259 'placeholder' => 'Example: Enter your QQ Username',
3260 'class' => "fab fa-qq",
3261 'tooltip' => 'Enter your QQ username. E.g., username',
3262 'icon_color' => 1
3263 ),
3264 'behance' => array(
3265 'text' => "Behance",
3266 'icon_text' => "",
3267 'hover_text' => "Behance",
3268 'background_color' => "#131418",
3269 'placeholder' => 'Example: https://www.behance.net/channel-link',
3270 'class' => "fab fa-behance",
3271 'tooltip' => 'Add your full profile link of Behance. E.g, <a href="https://www.behance.net/channel-link" target="_blank">https://www.behance.net/channel-link</a>',
3272 'icon_color' => 1
3273 ),
3274 'dribbble' => array(
3275 'text' => "Dribbble",
3276 'icon_text' => "",
3277 'hover_text' => "Dribbble",
3278 'background_color' => "#ea4c89",
3279 'placeholder' => 'Example: https://dribbble.com/channel-link',
3280 'class' => "fab fa-dribbble",
3281 'tooltip' => 'Add your full profile link of Dribble. E.g, <a href="https://dribbble.com/channel-link" target="_blank">https://dribbble.com/channel-link</a>',
3282 'icon_color' => 1
3283 ),
3284 'quora' => array(
3285 'text' => "Quora",
3286 'icon_text' => "",
3287 'hover_text' => "Quora",
3288 'background_color' => "#aa2200",
3289 'placeholder' => 'Example: https://www.quora.com/channel-link',
3290 'class' => "fab fa-quora",
3291 'tooltip' => 'Add your full profile link of Quora. E.g, <a href="https://www.quora.com/channel-link" target="_blank">https://www.quora.com/channel-link</a>',
3292 'icon_color' => 1
3293 ),
3294 'yelp' => array(
3295 'text' => "yelp",
3296 'icon_text' => "",
3297 'hover_text' => "yelp",
3298 'background_color' => "#c41200",
3299 'placeholder' => 'Example: https://www.yelp.com/biz/your_business_here',
3300 'class' => "fab fa-yelp",
3301 'tooltip' => 'Add your Yelp business link. E.g, <a href="https://www.yelp.com/biz/your_business_here" target="_blank">https://www.yelp.com/biz/your_business_here</a>',
3302 'icon_color' => 1
3303 ),
3304 'amazon' => array(
3305 'text' => "Amazon",
3306 'icon_text' => "",
3307 'hover_text' => "Amazon",
3308 'background_color' => "#3b7a57",
3309 'placeholder' => 'Example: https://www.amazon.com/your_store_or_product',
3310 'class' => "mystickyelement_amazon_icon",
3311 'tooltip' => 'Add your Amazon product link. E.g, <a href="https://www.amazon.com/your_store_or_product" target="_blank">https://www.amazon.com/your_store_or_product</a>',
3312 'icon_color' => 1
3313 ),
3314 'reddit' => array(
3315 'text' => "Reddit",
3316 'icon_text' => "",
3317 'hover_text' => "Reddit",
3318 'background_color' => "#FF4301",
3319 'placeholder' => 'Example: https://www.reddit.com/r/your_community',
3320 'class' => "fab fa-reddit-alien",
3321 'tooltip' => 'Add your Reddit community or profile link. E.g, <a href="https://www.reddit.com/r/your_community" target="_blank">https://www.reddit.com/r/your_community</a>',
3322 'icon_color' => 1
3323 ),
3324 'RSS' => array(
3325 'text' => "RSS",
3326 'icon_text' => "",
3327 'hover_text' => "RSS",
3328 'background_color' => "#ee802f",
3329 'placeholder' => 'Example: https://www.example.com/your_rss_feed',
3330 'class' => "fa fa-rss",
3331 'tooltip' => 'Add your RSS feed link. E.g, <a href="https://www.example.com/your_rss_feed" target="_blank">https://www.example.com/your_rss_feed</a>',
3332 'icon_color' => 1
3333 ),
3334 'flickr' => array(
3335 'text' => "Flickr",
3336 'icon_text' => "",
3337 'hover_text' => "Flickr",
3338 'background_color' => "#ff0084",
3339 'placeholder' => 'Example: https://www.flickr.com/photos/your_profile',
3340 'class' => "mystickyelement_flickr_icon",
3341 'tooltip' => 'Add your full profile link of Flickr E.g, <a href="https://www.flickr.com/photos/your_profile" target="_blank">https://www.flickr.com/photos/your_profile</a>',
3342 'icon_color' => 1
3343 ),
3344 'ebay' => array(
3345 'text' => "eBay",
3346 'icon_text' => "",
3347 'hover_text' => "eBay",
3348 'background_color' => "#000000",
3349 'placeholder' => 'Example: https://www.ebay.com/str/your_store',
3350 'class' => "mystickyelement_ebay_icon",
3351 'tooltip' => 'Add your eBay profile/product link. E.g, <a href="https://www.ebay.com/str/your_store" target="_blank">https://www.ebay.com/str/your_store</a>',
3352 'icon_color' => 1
3353 ),
3354 'etsy' => array(
3355 'text' => "Etsy",
3356 'icon_text' => "",
3357 'hover_text' => "Etsy",
3358 'background_color' => "#eb6d20",
3359 'placeholder' => 'Example: https://www.etsy.com/shop/your_shop',
3360 'class' => "fab fa-etsy",
3361 'tooltip' => 'Add your full shop link of Etsy. E.g, <a href="https://www.etsy.com/shop/your_shop" target="_blank">https://www.etsy.com/shop/your_shop</a>',
3362 'icon_color' => 1
3363 ),
3364 'slack' => array(
3365 'text' => "Slack",
3366 'icon_text' => "",
3367 'hover_text' => "Slack",
3368 'background_color' => "#3f0e40",
3369 'placeholder' => 'Example: https://your_workspace.slack.com/',
3370 'class' => "mystickyelement_slack_icon",
3371 'tooltip' => 'Add your Slack workspace link. E.g, <a href="https://your_workspace.slack.com/" target="">https://your_workspace.slack.com/</a>',
3372 'icon_color' => 1
3373 ),
3374 'trip_advisor' => array(
3375 'text' => "Trip Advisor",
3376 'icon_text' => "",
3377 'hover_text' => "Trip Advisor",
3378 'background_color' => "#00EB5B",
3379 'placeholder' => 'Example: https://www.tripadvisor.com/your_place',
3380 'class' => "mse-tripadvisor-icon",
3381 'tooltip' => 'Add your place link of TripAdvisor E.g, <a href="https://www.tripadvisor.com/your_place" target="_blank">https://www.tripadvisor.com/your_place</a>',
3382 'icon_color' => 1,
3383 'custom_svg_icon' => file_get_contents(MYSTICKYELEMENTS_PATH.'/images/tripadvisor-icon.svg'),
3384 ),
3385 'medium' => array(
3386 'text' => "Medium",
3387 'icon_text' => "",
3388 'hover_text' => "Medium",
3389 'background_color' => "#0000cd",
3390 'placeholder' => 'Example: https://medium.com/your_publication',
3391 'class' => "fab fa-medium",
3392 'tooltip' => 'Add your full profile link of Medium. E.g, <a href="https://medium.com/your_publication" target="">https://medium.com/your_publication</a>',
3393 'icon_color' => 1
3394 ),
3395 'google_play' => array(
3396 'text' => "Google Play",
3397 'icon_text' => "",
3398 'hover_text' => "Google Play",
3399 'background_color' => "#747474",
3400 'placeholder' => 'Example: https://play.google.com/store/apps/details?id=your_app',
3401 'class' => "mystickyelement_google_play_icon",
3402 'tooltip' => 'Add your Google Play link. E.g, <a href="https://play.google.com/store/apps/details?id=your_app" target="_blank">https://play.google.com/store/apps/details?id=your_app</a>',
3403 'icon_color' => 1
3404 ),
3405 'app_store' => array(
3406 'text' => "App Store (apple)",
3407 'icon_text' => "",
3408 'hover_text' => "App Store (apple)",
3409 'background_color' => "#1d77f2",
3410 'placeholder' => 'Example: https://apps.apple.com/app/your_app',
3411 'class' => "fab fa-app-store",
3412 'tooltip' => 'Add your Apple Appstore link. E.g, <a href="https://apps.apple.com/app/your_app" target="_blank">https://apps.apple.com/app/your_app</a>',
3413 'icon_color' => 1
3414 ),
3415 'fiverr' => array(
3416 'text' => "Fiverr",
3417 'icon_text' => "",
3418 'hover_text' => "Fiverr",
3419 'background_color' => "#00b22d",
3420 'placeholder' => 'Example: https://www.fiverr.com/your_profile',
3421 'class' => "mystickyelement_fiverr_icon",
3422 'tooltip' => 'Add your Fiverr profile link. E.g, <a href="https://www.fiverr.com/your_profile" target="_blank">https://www.fiverr.com/your_profile</a>',
3423 'icon_color' => 1
3424 ),
3425 'shopify' => array(
3426 'text' => "Shopify",
3427 'icon_text' => "",
3428 'hover_text' => "Shopify",
3429 'background_color' => "#96BF47",
3430 'placeholder' => 'Example: http://your_storemyshopify.com/',
3431 'class' => "mystickyelement_shopify_icon",
3432 'tooltip' => 'Add your Shopify store or product link. E.g, <a href="http://your_storemyshopify.com/" target="_blank">http://your_storemyshopify.com/</a>',
3433 'icon_color' => 1
3434 ),
3435 'printful' => array(
3436 'text' => "Printful",
3437 'icon_text' => "",
3438 'hover_text' => "Printful",
3439 'background_color' => "#000",
3440 'placeholder' => 'Example: https://www.printful.com/your_product',
3441 'class' => "mystickyelement_printful_icon",
3442 'tooltip' => 'Add your Printful product link. E.g, <a href="https://www.printful.com/your_product" target="_blank">https://www.printful.com/your_product</a>',
3443 'icon_color' => 1
3444 ),
3445 'gumroad' => array(
3446 'text' => "Gumroad",
3447 'icon_text' => "",
3448 'hover_text' => "Gumroad",
3449 'background_color' => "#36a9ae",
3450 'placeholder' => 'Example: https://gumroad.com/your_profile',
3451 'class' => "mystickyelement_gumroad_icon",
3452 'tooltip' => 'Add your Gumroad product link. E.g, <a href="https://gumroad.com/your_profile" target="_blank">https://gumroad.com/your_profile</a>',
3453 'icon_color' => 1
3454 ),
3455 'ok' => array(
3456 'text' => "OK.ru",
3457 'icon_text' => "",
3458 'hover_text' => "OK.ru",
3459 'background_color' => "#F6902C",
3460 'placeholder' => 'Example: https://ok.ru/your_profile',
3461 'class' => "fab fa-odnoklassniki",
3462 'tooltip' => 'Add your full profile link of Ok.ru. E.g, <a href="https://ok.ru/your_profile" target="_blank">https://ok.ru/your_profile</a>',
3463 'icon_color' => 1
3464 ),
3465
3466 'custom_one' => array(
3467 'text' => "Custom Link 1",
3468 'custom_tooltip' => "Custom Link 1",
3469 'icon_text' => "",
3470 'hover_text' => "Custom Link 1",
3471 'background_color' => "#7761DF",
3472 'placeholder' => 'Enter your custom social link',
3473 'class' => "fas fa-cloud-upload-alt",
3474 'custom' => 1,
3475 'tooltip' => '',
3476 'icon_color' => 1
3477 ),
3478 'custom_two' => array(
3479 'text' => "Custom Link 2",
3480 'custom_tooltip' => "Custom Link 2",
3481 'hover_text' => "Custom Link 2",
3482 'background_color' => "#7761DF",
3483 'placeholder' => 'Enter your custom social link',
3484 'class' => "fas fa-cloud-upload-alt",
3485 'is_locked' => 1,
3486 'custom' => 1,
3487 'tooltip' => '',
3488 'icon_color' => 1
3489 ),
3490 'custom_three' => array(
3491 'text' => "Custom Link 3",
3492 'custom_tooltip' => "Custom Link 3",
3493 'icon_text' => "",
3494 'hover_text' => "Custom Link 3",
3495 'background_color' => "#7761DF",
3496 'placeholder' => 'Enter your custom social link',
3497 'class' => "fas fa-cloud-upload-alt",
3498 'is_locked' => 1,
3499 'custom' => 1,
3500 'tooltip' => '',
3501 'icon_color' => 1
3502 ),
3503 'custom_four' => array(
3504 'text' => "Custom Link 4",
3505 'custom_tooltip' => "Custom Link 4",
3506 'icon_text' => "",
3507 'hover_text' => "Custom Link 4",
3508 'background_color' => "#7761DF",
3509 'placeholder' => 'Enter your custom social link',
3510 'class' => "fas fa-cloud-upload-alt",
3511 'is_locked' => 1,
3512 'custom' => 1,
3513 'tooltip' => '',
3514 'icon_color' => 1
3515 ),
3516 'custom_five' => array(
3517 'text' => "Custom Link 5",
3518 'custom_tooltip' => "Custom Link 5",
3519 'icon_text' => "",
3520 'hover_text' => "Custom Link 5",
3521 'background_color' => "#7761DF",
3522 'placeholder' => 'Enter your custom social link',
3523 'class' => "fas fa-cloud-upload-alt",
3524 'is_locked' => 1,
3525 'custom' => 1,
3526 'tooltip' => '',
3527 'icon_color' => 1
3528 ),
3529 'custom_six' => array(
3530 'text' => "Custom Link 6",
3531 'custom_tooltip' => "Custom Link 6",
3532 'icon_text' => "",
3533 'hover_text' => "Custom Link 6",
3534 'background_color' => "#7761DF",
3535 'placeholder' => 'Enter your custom social link',
3536 'class' => "fas fa-cloud-upload-alt",
3537 'is_locked' => 1,
3538 'custom' => 1,
3539 'tooltip' => '',
3540 'icon_color' => 1
3541 ),
3542 'custom_seven' => array(
3543 'text' => "Custom Shortcode/HTML 1",
3544 'custom_tooltip' => "Custom Shortcode/HTML 1",
3545 'icon_text' => "",
3546 'hover_text' => "Custom Shortcode/HTML 1",
3547 'background_color' => "#7761DF",
3548 'placeholder' => 'Enter your shortcode or custom IFRAME/HTML code',
3549 'class' => "fas fa-code",
3550 'custom' => 1,
3551 'custom_html' => 1,
3552 'tooltip' => '',
3553 'icon_color' => 1
3554 ),
3555 'custom_eight' => array(
3556 'text' => "Custom Shortcode/HTML 2",
3557 'custom_tooltip' => "Custom Shortcode/HTML 2",
3558 'icon_text' => "",
3559 'hover_text' => "Custom Shortcode/HTML 2",
3560 'background_color' => "#7761DF",
3561 'placeholder' => 'Enter your shortcode or custom IFRAME/HTML code',
3562 'class' => "fas fa-code",
3563 'is_locked' => 1,
3564 'custom' => 1,
3565 'custom_html' => 1,
3566 'icon_color' => 1,
3567 'tooltip' => ''
3568 ),
3569 'custom_nine' => array(
3570 'text' => "Custom Shortcode/HTML 3",
3571 'custom_tooltip' => "Custom Shortcode/HTML 3",
3572 'icon_text' => "",
3573 'hover_text' => "Custom Shortcode/HTML 3",
3574 'background_color' => "#7761DF",
3575 'placeholder' => 'Enter your shortcode or custom IFRAME/HTML code',
3576 'class' => "fas fa-code",
3577 'is_locked' => 1,
3578 'custom' => 1,
3579 'custom_html' => 1,
3580 'tooltip' => '',
3581 'icon_color' => 1
3582 ),
3583 'custom_ten' => array(
3584 'text' => "Custom Shortcode/HTML 4",
3585 'custom_tooltip' => "Custom Shortcode/HTML 4",
3586 'icon_text' => "",
3587 'hover_text' => "Custom Shortcode/HTML 4",
3588 'background_color' => "#7761DF",
3589 'placeholder' => 'Enter your shortcode or custom IFRAME/HTML code',
3590 'class' => "fas fa-code",
3591 'is_locked' => 1,
3592 'custom' => 1,
3593 'custom_html' => 1,
3594 'tooltip' => '',
3595 'icon_color' => 1
3596 ),
3597 'custom_eleven' => array(
3598 'text' => "Custom Shortcode/HTML 5",
3599 'custom_tooltip' => "Custom Shortcode/HTML 5",
3600 'icon_text' => "",
3601 'hover_text' => "Custom Shortcode/HTML 5",
3602 'background_color' => "#7761DF",
3603 'placeholder' => 'Enter your shortcode or custom IFRAME/HTML code',
3604 'class' => "fas fa-code",
3605 'is_locked' => 1,
3606 'custom' => 1,
3607 'custom_html' => 1,
3608 'tooltip' => '',
3609 'icon_color' => 1
3610 ),
3611 'custom_twelve' => array(
3612 'text' => "Custom Shortcode/HTML 6",
3613 'custom_tooltip' => "Custom Shortcode/HTML 6",
3614 'icon_text' => "",
3615 'hover_text' => "Custom Shortcode/HTML 6",
3616 'background_color' => "#7761DF",
3617 'placeholder' => 'Enter your shortcode or custom IFRAME/HTML code',
3618 'class' => "fas fa-code",
3619 'is_locked' => 1,
3620 'custom' => 1,
3621 'custom_html' => 1,
3622 'tooltip' => '',
3623 'icon_color' => 1
3624 ),
3625 );
3626
3627 return apply_filters('mystickyelements_social_channels_info', $social_channels);
3628 }
3629 }
3630
3631
3632
3633
3634 function mystickyelements_custom_social_channels()
3635 {
3636 $social_channels = array(
3637 'custom_channel' => array(
3638 'text' => "Custom Link",
3639 'custom_tooltip' => "Custom Link",
3640 'icon_text' => "",
3641 'hover_text' => "Custom Link",
3642 'background_color' => "#7761DF",
3643 'placeholder' => 'Enter your custom social link',
3644 'class' => "fas fa-cloud-upload-alt",
3645 'is_locked' => 0,
3646 'custom' => 1,
3647 'tooltip' => '',
3648 'icon_color' => 1
3649 ),
3650 'custom_shortcode' => array(
3651 'text' => "Custom Shortcode/HTML",
3652 'custom_tooltip' => "Custom Shortcode/HTML",
3653 'icon_text' => "",
3654 'hover_text' => "Custom Shortcode/HTML",
3655 'background_color' => "#7761DF",
3656 'placeholder' => 'Enter your shortcode or custom IFRAME/HTML code',
3657 'class' => "fas fa-code",
3658 'custom' => 1,
3659 'custom_html' => 1,
3660 'tooltip' => '',
3661 'icon_color' => 1
3662 ),
3663
3664 );
3665 return $social_channels;
3666 }
3667 function mystickyelements_admin_notices()
3668 {
3669
3670 if (isset($_GET['page']) && $_GET['page'] == 'my-sticky-elements-settings') {
3671
3672
3673 $activation_url = wp_nonce_url('options-general.php?page=my-sticky-elements-settings&update_version=1', 'mystickyelement_new_version', 'update_nonce');
3674 $admin_message = '<p>' . sprintf('<a href="%s" id="mystickyelement-update" class="button-primary">%s</a>', $activation_url, esc_html__('Move to the new version', 'mystickyelements')) . '</p>';
3675
3676 echo '<div class="updated settings-error notice is-dismissible">' . $admin_message . '</div>';
3677 }
3678 }
3679
3680 function mystickyelements_admin_init_update_version()
3681 {
3682
3683 if (isset($_GET['update_version']) && $_GET['update_version'] == 1) {
3684 if (isset($_GET['update_nonce']) && wp_verify_nonce($_GET['update_nonce'], 'mystickyelement_new_version')) {
3685 delete_option('mysticky_elements_options');
3686 delete_option('mysticky_elements_options0');
3687 delete_option('mysticky_elements_options1');
3688 delete_option('mysticky_elements_options2');
3689 delete_option('mysticky_elements_options3');
3690 delete_option('mysticky_elements_options4');
3691 delete_option('mysticky_elements_options5');
3692 delete_option('mysticky_elements_options6');
3693 delete_option('mysticky_elements_options7');
3694 delete_option('mysticky_elements_options8');
3695 delete_option('mysticky_elements_options9');
3696 mystickyelement_activate();
3697 wp_redirect(admin_url('admin.php?page=my-sticky-elements-settings')) ;
3698 exit;
3699 }
3700 }
3701 }
3702 add_action('admin_init', 'mystickyelements_admin_init_update_version');
3703
3704 function mystickyelements_change_menu_text()
3705 {
3706 global $submenu;
3707 if (isset($submenu['my-sticky-elements'])) {
3708 $totalItems = count($submenu['my-sticky-elements']) - 1;
3709 if (isset($submenu['my-sticky-elements'][$totalItems][0])) {
3710 $submenu['my-sticky-elements'][$totalItems][0] = '<span><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
3711 <path d="M13.0518 4.01946C12.9266 3.91499 12.7747 3.84781 12.6132 3.82557C12.4517 3.80333 12.2872 3.82693 12.1385 3.89367L9.3713 5.12414L7.76349 2.22571C7.68664 2.09039 7.5753 1.97785 7.44081 1.89956C7.30632 1.82127 7.15348 1.78003 6.99786 1.78003C6.84224 1.78003 6.6894 1.82127 6.55491 1.89956C6.42042 1.97785 6.30908 2.09039 6.23224 2.22571L4.62442 5.12414L1.85724 3.89367C1.70822 3.82703 1.54352 3.8034 1.38178 3.82545C1.22003 3.84751 1.06768 3.91437 0.941941 4.01849C0.816207 4.1226 0.722106 4.25982 0.670275 4.41461C0.618444 4.56941 0.610951 4.73562 0.648642 4.89446L2.0377 10.8171C2.06427 10.9318 2.11383 11.0399 2.18339 11.1348C2.25295 11.2297 2.34107 11.3096 2.44239 11.3695C2.57957 11.4516 2.73642 11.495 2.8963 11.4952C2.97402 11.4951 3.05133 11.484 3.12599 11.4624C5.65792 10.7624 8.33233 10.7624 10.8643 11.4624C11.0955 11.5232 11.3413 11.4898 11.5479 11.3695C11.6498 11.3103 11.7384 11.2307 11.8081 11.1357C11.8777 11.0406 11.9269 10.9321 11.9525 10.8171L13.3471 4.89446C13.3843 4.73558 13.3764 4.56945 13.3243 4.41482C13.2721 4.2602 13.1777 4.12326 13.0518 4.01946V4.01946Z" fill="white"/>
3712 </svg></span> '.esc_html__('Upgrade to Pro', 'mystickyelements');
3713 }
3714 }
3715 }
3716 add_action('admin_init', 'mystickyelements_change_menu_text');
3717
3718
3719
3720 /*
3721 * Check condition for older user
3722 *
3723 */
3724 $mysticky_elements_options = get_option('mysticky_elements_options');
3725 if (!empty($mysticky_elements_options)) {
3726 if (is_admin()) {
3727 $my_settings_page = new MyStickyElementsPage();
3728 }
3729
3730 add_action('wp_head', 'mysticky_element_build_stylesheet_content');
3731 add_action('wp_enqueue_scripts', 'mystickyelements_script');
3732 add_action('wp_footer', 'insert_my_footerrr');
3733
3734 add_action('admin_notices', 'mystickyelements_admin_notices');
3735
3736 } else {
3737
3738 add_action('admin_init', 'mystickyelements_admin_init');
3739
3740 require_once MYSTICKYELEMENTS_PATH . 'mystickyelements-fonts.php';
3741 require_once MYSTICKYELEMENTS_PATH . 'mystickyelements-fontawesome-icons.php';
3742 require_once MYSTICKYELEMENTS_PATH . 'class-email-signup.php';
3743 require_once MYSTICKYELEMENTS_PATH . 'class-help.php';
3744 require_once MYSTICKYELEMENTS_PATH . 'mystickyelements-admin.php';
3745 require_once MYSTICKYELEMENTS_PATH . 'mystickyelements-front.php';
3746 }
3747
3748
3749
3750 function mystickyelements_admin_init()
3751 {
3752 global $wpdb, $pagenow;
3753
3754 $chatway_action = isset($_GET['mse_action']) ? sanitize_text_field($_GET['mse_action']) : null;
3755 $nonce = isset($_GET['nonce']) ? sanitize_text_field($_GET['nonce']) : null;
3756 if ($chatway_action == 'download_csv_file' && !empty($nonce) && wp_verify_nonce($nonce, 'stickyelement-download-csv-file') && current_user_can('activate_plugins')) {
3757 $table_name = $wpdb->prefix . "mystickyelement_contact_lists";
3758 $query = "SELECT * FROM {$table_name} ORDER BY ID DESC";
3759 $result = $wpdb->get_results($query);
3760 $file = "mystickyelements-contact-leads.csv";
3761 $fp = fopen($file, "a") or die("Error Couldn't open $file for writing!");
3762 $all_data = '';
3763 $fields = array("ID", "Widget Name", "Name", "Phone", "Email", "Message", "Page Link", "Message Date");
3764 fputcsv($fp, $fields, ',', '"', '\\');
3765 foreach ($result as $res) {
3766 $res_ID = $res->ID;
3767 $res_name = $res->contact_name;
3768 $res_phone = $res->contact_phone;
3769 $res_email = $res->contact_email;
3770 $res_message = $res->contact_message;
3771 $res_message_date = $res->message_date;
3772 $widget_element_name = $res->widget_element_name;
3773 $page_link = $res->page_link;
3774 $custom_fields = $res->custom_fields;
3775
3776 $fields = array($res_ID, $widget_element_name, $res_name, $res_phone, $res_email, $res_message, $page_link ,$res_message_date);
3777
3778 fputcsv($fp, $fields, ',', '"', '\\');
3779 }
3780
3781 fclose($fp);
3782
3783 if (file_exists($file)) {
3784 header('Content-Type: application/csv');
3785 header('Content-Disposition: attachment; filename="' . basename($file) . '"');
3786 header('Content-Length: ' . filesize($file));
3787 readfile($file);
3788 unlink($file);
3789 exit;
3790 }
3791 }
3792
3793 if ($pagenow == 'plugins.php' || (isset($_GET['page']) && $_GET['page'] == 'my-sticky-elements')) {
3794 // add Contact Option field
3795 $field_check = $wpdb->get_var("SHOW COLUMNS FROM {$wpdb->prefix}mystickyelement_contact_lists LIKE 'contact_option'");
3796 if ('contact_option' != $field_check) {
3797 $wpdb->query("ALTER TABLE {$wpdb->prefix}mystickyelement_contact_lists ADD contact_option VARCHAR(255) NULL DEFAULT NULL");
3798 }
3799
3800 // add Contact Message date field
3801 $field_check = $wpdb->get_var("SHOW COLUMNS FROM {$wpdb->prefix}mystickyelement_contact_lists LIKE 'message_date'");
3802 if ('message_date' != $field_check) {
3803 $wpdb->query("ALTER TABLE {$wpdb->prefix}mystickyelement_contact_lists ADD message_date DATETIME NOT NULL default '0000-00-00 00:00:00'");
3804 }
3805
3806 // add Contact Widget Name field
3807 $field_check = $wpdb->get_var("SHOW COLUMNS FROM {$wpdb->prefix}mystickyelement_contact_lists LIKE 'widget_element_name'");
3808 if ('widget_element_name' != $field_check) {
3809 $wpdb->query("ALTER TABLE {$wpdb->prefix}mystickyelement_contact_lists ADD widget_element_name VARCHAR(255) NULL DEFAULT 'default'");
3810 }
3811
3812 // add Contact Custom Fields field
3813 $field_check = $wpdb->get_var("SHOW COLUMNS FROM {$wpdb->prefix}mystickyelement_contact_lists LIKE 'custom_fields'");
3814 if ('custom_fields' != $field_check) {
3815 $wpdb->query("ALTER TABLE {$wpdb->prefix}mystickyelement_contact_lists ADD custom_fields longtext");
3816 }
3817
3818 // add Page Link field
3819 $field_check = $wpdb->get_var("SHOW COLUMNS FROM {$wpdb->prefix}mystickyelement_contact_lists LIKE 'page_link'");
3820 if ('page_link' != $field_check) {
3821 $wpdb->query("ALTER TABLE {$wpdb->prefix}mystickyelement_contact_lists ADD page_link TEXT NULL DEFAULT NULL");
3822 }
3823
3824 // add consent checkbox
3825 $field_check = $wpdb->get_var("SHOW COLUMNS FROM {$wpdb->prefix}mystickyelement_contact_lists LIKE 'consent_checkbox'");
3826 if ('consent_checkbox' != $field_check) {
3827 $wpdb->query("ALTER TABLE {$wpdb->prefix}mystickyelement_contact_lists ADD consent_checkbox BOOLEAN NULL DEFAULT false");
3828 }
3829
3830 // add IP Address
3831 $field_check = $wpdb->get_var("SHOW COLUMNS FROM {$wpdb->prefix}mystickyelement_contact_lists LIKE 'ip_address'");
3832 if ('ip_address' != $field_check) {
3833 $wpdb->query("ALTER TABLE {$wpdb->prefix}mystickyelement_contact_lists ADD ip_address TEXT NULL DEFAULT NULL");
3834 }
3835 }//end if
3836
3837 if ($pagenow == 'plugins.php' || (isset($_GET['page']) && $_GET['page'] == 'my-sticky-elements-analytics')) {
3838
3839 include_once ABSPATH.'wp-admin/includes/upgrade.php';
3840 $charset_collate = $wpdb->get_charset_collate();
3841
3842 $mystickyelement_widget_analytics_table = $wpdb->prefix.'mystickyelement_widget_analysis';
3843
3844 if ($wpdb->get_var("show tables like '{$mystickyelement_widget_analytics_table}'") != $mystickyelement_widget_analytics_table) {
3845
3846 $mystickyelement_widget_analytics_sql = "CREATE TABLE {$mystickyelement_widget_analytics_table} (
3847 id bigint(11) NOT NULL AUTO_INCREMENT,
3848 widget_id int(11) NULL,
3849 channel_slug varchar(50) NULL,
3850 no_of_views int(11) NOT NULL DEFAULT '0',
3851 no_of_clicks int(11) NOT NULL DEFAULT '0',
3852 analysis_date bigint(20) NOT NULL DEFAULT '0',
3853 PRIMARY KEY (ID)
3854 ) $charset_collate;";
3855
3856 dbDelta($mystickyelement_widget_analytics_sql);
3857 }
3858 }
3859
3860 if (!get_option('mystickyelements-widgets') && !get_option('mystickyelements-update_2_0')) {
3861 update_option('mystickyelements-widgets', array('MyStickyElements #1'));
3862 update_option('mystickyelements-update_2_0', true);
3863 }
3864 }
3865
3866 function mystickyelement_default_settings($section)
3867 {
3868
3869 $contact_form = array(
3870 'enable' => 1,
3871 'name' => 1,
3872 'name_require' => '',
3873 'name_value' => '',
3874 'phone' => 1,
3875 'phone_require' => 1,
3876 'phone_value' => '',
3877 'email' => 1,
3878 'email_require' => 1,
3879 'email_value' => '',
3880 'message' => 1,
3881 'message_value' => '',
3882 'dropdown' => '',
3883 'dropdown_require' => '',
3884 'submit_button_background_color' => '#7761DF',
3885 'submit_button_text_color' => '#FFFFFF',
3886 'submit_button_text' => 'Submit',
3887 'desktop' => 1,
3888 'mobile' => 1,
3889 'direction' => 'LTR',
3890 'tab_background_color' => '#7761DF',
3891 'tab_text_color' => '#FFFFFF',
3892 'headine_text_color' => '#7761DF',
3893 'text_in_tab' => 'Contact Us',
3894 'send_leads' => 'database',
3895 'sent_to_mail' => '',
3896 'form_css' => '',
3897 'placeholder_color' => '#4F4F4F',
3898 'contact_title_text' => 'Contact Form',
3899 );
3900
3901
3902 $social_channels = array(
3903 'enable' => 1,
3904 'whatsapp' => 1,
3905 //'facebook_messenger'=> 1,
3906 );
3907
3908
3909
3910 $social_channels_tabs['whatsapp'] = array(
3911 'text' => "",
3912 'hover_text' => "WhatsApp",
3913 'bg_color' => "#26D367",
3914 'desktop' => 1,
3915 'mobile' => 1,
3916 );
3917
3918
3919
3920
3921 $general_settings = array(
3922 'position' => 'left',
3923 'position_mobile' => 'left',
3924 'open_tabs_when' => 'hover',
3925 'mobile_behavior' => 'disable',
3926 'flyout' => 'disable',
3927 'custom_position' => '',
3928 'tabs_css' => '',
3929 'minimize_tab' => '1',
3930 'on_load_when' => 'open',
3931 'minimize_tab_background_color' => '#000000',
3932 'page_settings' => '',
3933 'placeholder_color' => '#4F4F4F',
3934 );
3935
3936 return $$section;
3937 }
3938
3939
3940
3941 add_action('admin_footer', 'mystickyelements_admin_footer_style');
3942 function mystickyelements_admin_footer_style()
3943 {
3944 ?>
3945 <style>
3946 #adminmenu .toplevel_page_my-sticky-elements > ul > li:last-child {
3947 padding: 5px 10px;
3948 }
3949 #adminmenu .toplevel_page_my-sticky-elements > ul > li:last-child a {
3950 display: flex;
3951 background-color: #B78DEB;
3952 border-radius: 6px;
3953 font-size: 12px;
3954 gap: 4px;
3955 padding: 4px 8px;
3956 color: #ffffff;
3957 align-items: center;
3958 transition: all 0.2s linear;
3959 font-weight: normal;
3960 box-shadow: 0px 6px 8px 0px #B78DEB3D;
3961 justify-content: center;
3962 }
3963 #adminmenu .toplevel_page_my-sticky-elements > ul > li:last-child a:hover, #adminmenu .toplevel_page_my-sticky-elements > ul > li:last-child a.current {
3964 box-shadow: 0px 6px 8px 0px #B78DEB3D;
3965 color: #ffffff;
3966 background-color: #9565d0;
3967 font-weight: normal;
3968 }
3969 #adminmenu .toplevel_page_my-sticky-elements > ul > li:last-child a span {
3970 flex: 0 0 16px;
3971 height: 16px;
3972 background-color: #c5a4ef;
3973 border-radius: 4px;
3974 padding: 2px;
3975 display: inline-flex;
3976 transition: all 0.2s linear;
3977 }
3978 #adminmenu .toplevel_page_my-sticky-elements > ul > li:last-child a:hover span {
3979 background-color: #B78DEB;
3980 }
3981 #adminmenu .toplevel_page_my-sticky-elements > ul > li:last-child a span svg {
3982 width: 100%;
3983 height: 100%;
3984 }
3985 </style>
3986 <?php
3987 }
3988