PluginProbe
Simple Ticker / 2.07
Simple Ticker v2.07
trunk 1.0 1.01 1.02 1.03 1.04 1.05 1.06 1.07 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 3.00 3.01 3.02 3.03 All 33 releases
simple-ticker / lib / SimpleTickerAdmin.php

SimpleTickerAdmin.php in Simple Ticker 2.07, at lib/SimpleTickerAdmin.php

485 lines 22.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Simple Ticker
4 *
5 * @package SimpleTicker
6 * @subpackage SimpleTicker Management screen
7 Copyright (c) 2016- Katsushi Kawamori (email : dodesyoswift312@gmail.com)
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; version 2 of the License.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22 $simpletickeradmin = new SimpleTickerAdmin();
23
24 class SimpleTickerAdmin {
25
26 /* ==================================================
27 * Construct
28 * @since 1.06
29 */
30 public function __construct() {
31
32 add_action( 'admin_menu', array($this, 'plugin_menu'));
33 add_action( 'admin_enqueue_scripts', array($this, 'load_custom_wp_admin_style') );
34 add_filter( 'plugin_action_links', array($this, 'settings_link'), 10, 2 );
35
36 }
37
38 /* ==================================================
39 * Add a "Settings" link to the plugins page
40 * @since 1.0
41 */
42 public function settings_link( $links, $file ) {
43 static $this_plugin;
44 if ( empty($this_plugin) ) {
45 $this_plugin = 'simple-ticker/simpleticker.php';
46 }
47 if ( $file == $this_plugin ) {
48 $links[] = '<a href="'.admin_url('options-general.php?page=SimpleTicker').'">'.__( 'Settings').'</a>';
49 }
50 return $links;
51 }
52
53 /* ==================================================
54 * Settings page
55 * @since 1.0
56 */
57 public function plugin_menu() {
58 add_options_page( 'Simple Ticker Options', 'Simple Ticker', 'manage_options', 'SimpleTicker', array($this, 'plugin_options') );
59 }
60
61 /* ==================================================
62 * Add Css and Script
63 * @since 1.0
64 */
65 public function load_custom_wp_admin_style() {
66 if ($this->is_my_plugin_screen()) {
67 wp_enqueue_style( 'jquery-responsiveTabs', plugin_dir_url( __DIR__ ).'css/responsive-tabs.css' );
68 wp_enqueue_style( 'jquery-responsiveTabs-style', plugin_dir_url( __DIR__ ).'css/style.css' );
69 wp_enqueue_script('jquery');
70 wp_enqueue_script( 'jquery-responsiveTabs', plugin_dir_url( __DIR__ ).'js/jquery.responsiveTabs.min.js' );
71 wp_enqueue_script( 'jquery-jscolor', plugin_dir_url( __DIR__ ).'js/jscolor.min.js' );
72 wp_enqueue_script( 'simpleticker-js', plugin_dir_url( __DIR__ ).'js/jquery.simpleticker.js', array('jquery') );
73 }
74 }
75
76 /* ==================================================
77 * For only admin style
78 * @since 1.0
79 */
80 private function is_my_plugin_screen() {
81 $screen = get_current_screen();
82 if (is_object($screen) && $screen->id == 'settings_page_SimpleTicker') {
83 return TRUE;
84 } else {
85 return FALSE;
86 }
87 }
88
89 /* ==================================================
90 * Settings page
91 * @since 1.0
92 */
93 public function plugin_options() {
94
95 if ( !current_user_can( 'manage_options' ) ) {
96 wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
97 }
98
99
100 if( !empty($_POST) ) {
101 $post_nonce_field = 'simpleticker_tabs';
102 if ( isset($_POST[$post_nonce_field]) && $_POST[$post_nonce_field] ) {
103 if ( check_admin_referer( 'simpleticker_settings', $post_nonce_field ) ) {
104 $this->options_updated(intval($_POST['simpleticker_admin_tabs']));
105 }
106 }
107 }
108
109 $scriptname = admin_url('options-general.php?page=SimpleTicker');
110
111 $simpleticker_option = get_option('simple_ticker');
112
113 ?>
114
115 <div class="wrap">
116 <h2>Simple Ticker</h2>
117
118 <div id="simpleticker-admin-tabs">
119 <ul>
120 <li><a href="#simpleticker-admin-tabs-1"><?php _e('How to use', 'simple-ticker'); ?></a></li>
121 <li><a href="#simpleticker-admin-tabs-2"><?php _e('Settings'); ?></a></li>
122 <li><a href="#simpleticker-admin-tabs-3"><?php _e('Donate to this plugin &#187;'); ?></a></li>
123 <!--
124 <li><a href="#simpleticker-admin-tabs-4">FAQ</a></li>
125 -->
126 </ul>
127 <div id="simpleticker-admin-tabs-1">
128 <div class="wrap">
129
130 <h2><?php _e('How to use', 'simple-ticker'); ?></h2>
131
132 <div style="width: 100%; height: 100%; margin: 5px; padding: 5px; border: #CCC 2px solid;">
133 <h3><?php _e('Set the widget', 'simple-ticker'); ?></h3>
134 <?php
135 $widget_html = '<a href="'.admin_url('widgets.php').'" style="text-decoration: none; word-break: break-all;">'.__('Widgets').'['.__( 'Ticker', 'simple-ticker' ).']</a>';
136 ?>
137 <div style="padding: 5px 20px; font-weight: bold;"><?php echo sprintf(__('Please set the %1$s.', 'simple-ticker'), $widget_html); ?></div>
138 </div>
139
140 <div style="width: 100%; height: 100%; margin: 5px; padding: 5px; border: #CCC 2px solid;">
141 <h3><?php _e('Set up a shortcode', 'simple-ticker'); ?></h3>
142
143 <div style="padding: 5px 20px; font-weight: bold;"><?php _e('Example', 'simple-ticker'); ?></div>
144 <div style="padding: 5px 25px;"><?php _e('to the post or pages', 'simple-ticker'); ?></div>
145 <div style="padding: 5px 35px;"><code>[simpleticker]</code></div>
146 <div style="padding: 5px 35px;"><code>[simpleticker ticker1_text="Ticker test!!" ticker1_color="#008000" sticky_posts_display=FALSE]</code></div>
147 <div style="padding: 5px 25px;"><?php _e('to the template of the theme', 'simple-ticker'); ?></div>
148 <div style="padding: 5px 35px;"><code>&lt;?php echo do_shortcode('[simpleticker]'); ?&gt</code></div>
149 <div style="padding: 5px 35px;"><code>&lt;?php echo do_shortcode('[simpleticker ticker1_text="Ticker test!!" ticker1_color="#008000" sticky_posts_display=FALSE]'); ?&gt</code></div>
150
151 <div style="padding: 5px 20px; font-weight: bold;"><?php _e('Description of each attribute', 'simple-ticker'); ?></div>
152
153 <div style="padding: 5px 35px;"><?php _e('Text of ticker', 'simple-ticker'); ?> : <code>ticker1_text</code> <code>ticker2_text</code> <code>ticker3_text</code></div>
154 <div style="padding: 5px 35px;"><?php _e('Color of ticker', 'simple-ticker'); ?> : <code>ticker1_color</code> <code>ticker2_color</code> <code>ticker3_color</code></div>
155 <div style="padding: 5px 35px;"><?php _e('Boolean value of sticky_posts', 'simple-ticker'); ?> : <code>sticky_posts_display</code></div>
156 <div style="padding: 5px 35px;"><?php _e('Title color of sticky_posts', 'simple-ticker'); ?> : <code>sticky_posts_title_color</code></div>
157 <div style="padding: 5px 35px;"><?php _e('Content color of sticky_posts', 'simple-ticker'); ?> : <code>sticky_posts_content_color</code></div>
158 <div style="padding: 5px 35px;"><?php _e('Boolean value of WooCommerce sale', 'simple-ticker'); ?> : <code>woo_sales_display</code></div>
159 <div style="padding: 5px 35px;"><?php _e('Color of WooCommerce sale', 'simple-ticker'); ?> : <code>woo_sales_color</code></div>
160
161 <?php
162 $settings_html = '<a href="'.$scriptname.'#simpleticker-admin-tabs-2" style="text-decoration: none; word-break: break-all;">'.__('Settings', 'simple-ticker').'</a>';
163 ?>
164 <div style="padding: 5px 20px; font-weight: bold;"><?php echo sprintf(__('Attribute value of short codes can also be specified in the %1$s. Attribute value of the short code takes precedence.', 'simple-ticker'), $settings_html); ?></div>
165 </div>
166
167 </div>
168 </div>
169
170 <div id="simpleticker-admin-tabs-2">
171 <div class="wrap">
172
173 <h2><?php _e('Settings'); ?></h2>
174
175 <form method="post" action="<?php echo $scriptname.'#simpleticker-admin-tabs-2'; ?>">
176 <?php wp_nonce_field('simpleticker_settings', 'simpleticker_tabs'); ?>
177
178 <div class="submit">
179 <input type="submit" class="button" name="Submit" value="<?php _e('Save Changes') ?>" />
180 <input type="submit" class="button" name="Default" value="<?php _e('Default') ?>" />
181 </div>
182
183 <div style="width: 100%; height: 100%; margin: 5px; padding: 5px; border: #CCC 2px solid;">
184 <div style="display: block; padding:5px 5px;">
185 <h3><?php _e('Speed adjust', 'simple-ticker'); ?></h3>
186 <?php _e('Up', 'simple-ticker'); ?><input type="range" style="vertical-align:middle;" step="1" min="20" max="280" name="simple_ticker_speed" value="<?php echo intval($simpleticker_option['speed']); ?>" /><?php _e('Down', 'simple-ticker'); ?>
187 </div>
188 </div>
189
190 <div style="width: 100%; height: 100%; margin: 5px; padding: 5px; border: #CCC 2px solid;">
191 <h3><?php _e('Insert before and after post without using shortcode', 'simple-ticker'); ?></h3>
192 <div style="display: block;padding:5px 20px">
193 <input type="radio" name="simple_ticker_insert" value="none" <?php if ($simpleticker_option['insert'] === 'none') echo 'checked'; ?>>
194 <?php _e('none'); ?>
195 </div>
196 <div style="display: block;padding:5px 20px">
197 <input type="radio" name="simple_ticker_insert" value="before" <?php if ($simpleticker_option['insert'] === 'before') echo 'checked'; ?>>
198 <?php _e('Before post', 'simple-ticker'); ?>
199 </div>
200 <div style="display: block;padding:5px 20px">
201 <input type="radio" name="simple_ticker_insert" value="after" <?php if ($simpleticker_option['insert'] === 'after') echo 'checked'; ?>>
202 <?php _e('After post', 'simple-ticker'); ?>
203 </div>
204 <div style="display: block;padding:5px 20px">
205 <input type="radio" name="simple_ticker_insert" value="beforeafter" <?php if ($simpleticker_option['insert'] === 'beforeafter') echo 'checked'; ?>>
206 <?php _e('Before and after post', 'simple-ticker'); ?>
207 </div>
208 </div>
209
210 <div style="width: 100%; height: 100%; margin: 5px; padding: 5px; border: #CCC 2px solid;">
211
212 <div style="display: block; padding:5px 5px;">
213 <h3><?php _e('Own Ticker', 'simple-ticker'); ?></h3>
214 <div style="display: block; padding:5px 20px;">
215 <?php _e('Ticker1', 'simple-ticker'); ?> :
216 <div style="display: block; padding:5px 35px;">
217 <div>
218 <?php _e('Text', 'simple-ticker'); ?> :
219 <textarea name="simpleticker_ticker1_text" rows="4" cols="40" style="vertical-align: top"><?php echo $simpleticker_option['ticker1']['text']; ?></textarea>
220 </div>
221 <div>
222 <?php _e('Color', 'simple-ticker'); ?> :
223 <input type="text" class="jscolor" name="simpleticker_ticker1_color" value="<?php echo $simpleticker_option['ticker1']['color']; ?>" size="10" />
224 </div>
225 </div>
226 </div>
227 <div style="display: block; padding:5px 20px;">
228 <?php _e('Ticker2', 'simple-ticker'); ?> :
229 <div style="display: block; padding:5px 35px;">
230 <div>
231 <?php _e('Text', 'simple-ticker'); ?> :
232 <textarea name="simpleticker_ticker2_text" rows="4" cols="40" style="vertical-align: top"><?php echo $simpleticker_option['ticker2']['text']; ?></textarea>
233 </div>
234 <div>
235 <?php _e('Color', 'simple-ticker'); ?> :
236 <input type="text" class="jscolor" name="simpleticker_ticker2_color" value="<?php echo $simpleticker_option['ticker2']['color']; ?>" size="10" />
237 </div>
238 </div>
239 </div>
240 <div style="display: block; padding:5px 20px;">
241 <?php _e('Ticker3', 'simple-ticker'); ?> :
242 <div style="display: block; padding:5px 35px;">
243 <div>
244 <?php _e('Text', 'simple-ticker'); ?> :
245 <textarea name="simpleticker_ticker3_text" rows="4" cols="40" style="vertical-align: top"><?php echo $simpleticker_option['ticker3']['text']; ?></textarea>
246 </div>
247 <div>
248 <?php _e('Color', 'simple-ticker'); ?> :
249 <input type="text" class="jscolor" name="simpleticker_ticker3_color" value="<?php echo $simpleticker_option['ticker3']['color']; ?>" size="10" />
250 </div>
251 </div>
252 </div>
253 </div>
254 </div>
255 <div style="width: 100%; height: 100%; margin: 5px; padding: 5px; border: #CCC 2px solid;">
256 <div style="display: block; padding:5px 5px;">
257 <h3><?php _e('Sticky Posts', 'simple-ticker'); ?></h3>
258 <div style="display: block; padding:5px 20px;">
259 <input type="checkbox" name="simpleticker_sticky_posts" value="1" <?php checked('1', $simpleticker_option['sticky_posts']['display']); ?> />
260 <?php _e('Include sticky_posts', 'simple-ticker'); ?>
261 </div>
262 <div style="display: block; padding:5px 35px;">
263 <?php _e('Title color', 'simple-ticker'); ?> :
264 <input type="text" class="jscolor" name="simpleticker_sticky_posts_titlecolor" value="<?php echo $simpleticker_option['sticky_posts']['title_color']; ?>" size="10" />
265 </div>
266 <div style="display: block; padding:5px 35px;">
267 <?php _e('Content color', 'simple-ticker'); ?> :
268 <input type="text" class="jscolor" name="simpleticker_sticky_posts_contentcolor" value="<?php echo $simpleticker_option['sticky_posts']['content_color']; ?>" size="10" />
269 </div>
270 </div>
271 </div>
272 <div style="width: 100%; height: 100%; margin: 5px; padding: 5px; border: #CCC 2px solid;">
273 <div style="display: block; padding:5px 5px;">
274 <h3><?php _e('WooCommerce Sales', 'simple-ticker'); ?></h3>
275 <div style="display: block; padding:5px 20px;">
276 <input type="checkbox" name="simpleticker_woo_sales" value="1" <?php checked('1', $simpleticker_option['woo_sales']['display']); ?> />
277 <?php _e('Include WooCommerce Sales', 'simple-ticker'); ?>
278 </div>
279 <div style="display: block; padding:5px 35px;">
280 <?php _e('Color', 'simple-ticker'); ?> :
281 <input type="text" class="jscolor" name="simpleticker_woo_sales_color" value="<?php echo $simpleticker_option['woo_sales']['color']; ?>" size="10" />
282 </div>
283 <div style="display: block; padding:5px 35px;">
284 <div><?php _e('WooCommerce Sales', 'simple-ticker'); ?> <?php _e('Tags'); ?></div>
285 <div style="display: block; padding:5px 45px;">
286 <li>
287 [<b>%regular_price%</b> : <?php _e('List price' ,'simple-ticker'); ?>]
288 [<b>%sale_price%</b> : <?php _e('Sale price' ,'simple-ticker'); ?>]
289 [<b>%dis_rate_price%</b> : <?php _e('Discount price' ,'simple-ticker'); ?>]
290 [<b>%dis_rate_percent%</b> : <?php _e('Discount rate' ,'simple-ticker'); ?>]
291 [<b>%to_date%</b> : <?php _e('Last day of sale' ,'simple-ticker'); ?>]
292 [<b>%interval_day%</b> : <?php _e('Remaining number of selling days' ,'simple-ticker'); ?>]
293 [<b>%interval_time%</b> : <?php _e('Remaining sales time' ,'simple-ticker'); ?>]
294 </li>
295 <li><b><?php _e('Please write any letters between tags. You can move and delete tags freely.' ,'simple-ticker'); ?></b></li>
296 <div>
297 <textarea name="simpleticker_woo_sales_text" style="width: 100%;"><?php echo $simpleticker_option['woo_sales']['text']; ?></textarea>
298 </div>
299 </div>
300 </div>
301 </div>
302 </div>
303
304 <div class="submit">
305 <input type="hidden" name="simpleticker_admin_tabs" value="2" />
306 <input type="submit" class="button" name="Submit" value="<?php _e('Save Changes') ?>" />
307 </div>
308
309 </form>
310
311 </div>
312 </div>
313
314 <div id="simpleticker-admin-tabs-3">
315 <div class="wrap">
316 <?php $this->credit(); ?>
317 </div>
318 </div>
319
320 <!--
321 <div id="simpleticker-admin-tabs-4">
322 <div class="wrap">
323 <h2>FAQ</h2>
324
325 </div>
326 </div>
327 -->
328
329 </div>
330 </div>
331 <?php
332
333 }
334
335 /* ==================================================
336 * Credit
337 */
338 private function credit() {
339
340 $plugin_name = NULL;
341 $plugin_ver_num = NULL;
342 $plugin_path = plugin_dir_path( __DIR__ );
343 $plugin_dir = untrailingslashit($plugin_path);
344 $slugs = explode('/', $plugin_dir);
345 $slug = end($slugs);
346 $files = scandir($plugin_dir);
347 foreach ($files as $file) {
348 if($file == '.' || $file == '..' || is_dir($plugin_path.$file)){
349 continue;
350 } else {
351 $exts = explode('.', $file);
352 $ext = strtolower(end($exts));
353 if ( $ext === 'php' ) {
354 $plugin_datas = get_file_data( $plugin_path.$file, array('name'=>'Plugin Name', 'version' => 'Version') );
355 if ( array_key_exists( "name", $plugin_datas ) && !empty($plugin_datas['name']) && array_key_exists( "version", $plugin_datas ) && !empty($plugin_datas['version']) ) {
356 $plugin_name = $plugin_datas['name'];
357 $plugin_ver_num = $plugin_datas['version'];
358 break;
359 }
360 }
361 }
362 }
363 $plugin_version = __('Version:').' '.$plugin_ver_num;
364 $faq = __('https://wordpress.org/plugins/'.$slug.'/faq', $slug);
365 $support = 'https://wordpress.org/support/plugin/'.$slug;
366 $review = 'https://wordpress.org/support/view/plugin-reviews/'.$slug;
367 $translate = 'https://translate.wordpress.org/projects/wp-plugins/'.$slug;
368 $facebook = 'https://www.facebook.com/katsushikawamori/';
369 $twitter = 'https://twitter.com/dodesyo312';
370 $youtube = 'https://www.youtube.com/channel/UC5zTLeyROkvZm86OgNRcb_w';
371 $donate = __('https://shop.riverforest-wp.info/donate/', $slug);
372
373 ?>
374 <span style="font-weight: bold;">
375 <div>
376 <?php echo $plugin_version; ?> |
377 <a style="text-decoration: none;" href="<?php echo $faq; ?>" target="_blank"><?php _e('FAQ'); ?></a> | <a style="text-decoration: none;" href="<?php echo $support; ?>" target="_blank"><?php _e('Support Forums'); ?></a> | <a style="text-decoration: none;" href="<?php echo $review; ?>" target="_blank"><?php _e('Reviews', 'media-from-ftp'); ?></a>
378 </div>
379 <div>
380 <a style="text-decoration: none;" href="<?php echo $translate; ?>" target="_blank"><?php echo sprintf(__('Translations for %s'), $plugin_name); ?></a> | <a style="text-decoration: none;" href="<?php echo $facebook; ?>" target="_blank"><span class="dashicons dashicons-facebook"></span></a> | <a style="text-decoration: none;" href="<?php echo $twitter; ?>" target="_blank"><span class="dashicons dashicons-twitter"></span></a> | <a style="text-decoration: none;" href="<?php echo $youtube; ?>" target="_blank"><span class="dashicons dashicons-video-alt3"></span></a>
381 </div>
382 </span>
383
384 <div style="width: 250px; height: 180px; margin: 5px; padding: 5px; border: #CCC 2px solid;">
385 <h3><?php _e('Please make a donation if you like my work or would like to further the development of this plugin.', $slug); ?></h3>
386 <div style="text-align: right; margin: 5px; padding: 5px;"><span style="padding: 3px; color: #ffffff; background-color: #008000">Plugin Author</span> <span style="font-weight: bold;">Katsushi Kawamori</span></div>
387 <button type="button" style="margin: 5px; padding: 5px;" onclick="window.open('<?php echo $donate; ?>')"><?php _e('Donate to this plugin &#187;'); ?></button>
388 </div>
389
390 <?php
391
392 }
393
394 /* ==================================================
395 * Update wp_options table.
396 * @param string $tabs
397 * @since 1.0
398 */
399 private function options_updated($tabs){
400
401 include_once( dirname(__FILE__).'/SimpleTicker.php' );
402 $simpleticker = new SimpleTicker();
403
404 $woo_sales_text_tag_def = '%regular_price% %sale_price% %dis_rate_price% %dis_rate_percent% %to_date% %interval_day% %interval_time%';
405 $simple_ticker_reset_tbl = array(
406 'speed' => 150,
407 'insert' => 'none',
408 'ticker1' => array(
409 'text' => '',
410 'color' => 'ff0000'
411 ),
412 'ticker2' => array(
413 'text' => '',
414 'color' => 'ffff00'
415 ),
416 'ticker3' => array(
417 'text' => '',
418 'color' => '008000'
419 ),
420 'sticky_posts' => array(
421 'display' => TRUE,
422 'title_color' => 'ff0000',
423 'content_color' => '000000'
424 ),
425 'woo_sales' => array(
426 'display' => FALSE,
427 'color' => '000000',
428 'text' => $woo_sales_text_tag_def
429 )
430 );
431
432 switch ($tabs) {
433 case 1:
434 break;
435 case 2:
436 if ( !empty($_POST['Default']) ) {
437 update_option( 'simple_ticker', $simple_ticker_reset_tbl );
438 echo '<div class="notice notice-success is-dismissible"><ul><li>'.__('Settings').' --> '.__('Default').' --> '.__('Changes saved.').'</li></ul></div>';
439 } else {
440 $simple_ticker_settings = get_option('simple_ticker');
441 $simple_ticker_settings['speed'] = intval($_POST['simple_ticker_speed']);
442 $simple_ticker_settings['insert'] = sanitize_text_field($_POST['simple_ticker_insert']);
443 if ( !empty($_POST['simpleticker_ticker1_text']) ) {
444 $simple_ticker_settings['ticker1']['text'] = $simpleticker->html_text(sanitize_text_field($_POST['simpleticker_ticker1_text']));
445 }
446 $simple_ticker_settings['ticker1']['color'] = sanitize_text_field($_POST['simpleticker_ticker1_color']);
447 if ( !empty($_POST['simpleticker_ticker2_text']) ) {
448 $simple_ticker_settings['ticker2']['text'] = $simpleticker->html_text(sanitize_text_field($_POST['simpleticker_ticker2_text']));
449 }
450 $simple_ticker_settings['ticker2']['color'] = sanitize_text_field($_POST['simpleticker_ticker2_color']);
451 if ( !empty($_POST['simpleticker_ticker3_text']) ) {
452 $simple_ticker_settings['ticker3']['text'] = $simpleticker->html_text(sanitize_text_field($_POST['simpleticker_ticker3_text']));
453 }
454 $simple_ticker_settings['ticker3']['color'] = sanitize_text_field($_POST['simpleticker_ticker3_color']);
455 if ( !empty($_POST['simpleticker_sticky_posts']) ) {
456 $simple_ticker_settings['sticky_posts']['display'] = intval($_POST['simpleticker_sticky_posts']);
457 } else {
458 $simple_ticker_settings['sticky_posts']['display'] = FALSE;
459 }
460 $simple_ticker_settings['sticky_posts']['title_color'] = sanitize_text_field($_POST['simpleticker_sticky_posts_titlecolor']);
461 $simple_ticker_settings['sticky_posts']['content_color'] = sanitize_text_field($_POST['simpleticker_sticky_posts_contentcolor']);
462 if ( !empty($_POST['simpleticker_woo_sales']) ) {
463 $simple_ticker_settings['woo_sales']['display'] = intval($_POST['simpleticker_woo_sales']);
464 } else {
465 $simple_ticker_settings['woo_sales']['display'] = FALSE;
466 }
467 $simple_ticker_settings['woo_sales']['color'] = sanitize_text_field($_POST['simpleticker_woo_sales_color']);
468 if ( !empty($_POST['simpleticker_woo_sales_text']) ) {
469 $simple_ticker_settings['woo_sales']['text'] = htmlspecialchars($_POST['simpleticker_woo_sales_text']);
470 }
471 update_option( 'simple_ticker', $simple_ticker_settings );
472 echo '<div class="notice notice-success is-dismissible"><ul><li>'.__('Settings').' --> '.__('Changes saved.').'</li></ul></div>';
473 }
474 break;
475 }
476
477 unset($simpleticker);
478
479 return;
480
481 }
482
483 }
484
485 ?>