| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 |
|
| 4 |
if ( ! class_exists( 'ewdusSettings' ) ) { |
| 5 |
/** |
| 6 |
* Class to handle configurable settings for Ultimate Slider |
| 7 |
* @since 1.0.0 |
| 8 |
*/ |
| 9 |
class ewdusSettings { |
| 10 |
|
| 11 |
/** |
| 12 |
* Default values for settings |
| 13 |
* @since 1.0.0 |
| 14 |
*/ |
| 15 |
public $defaults = array(); |
| 16 |
|
| 17 |
/** |
| 18 |
* Stored values for settings |
| 19 |
* @since 1.0.0 |
| 20 |
*/ |
| 21 |
public $settings = array(); |
| 22 |
|
| 23 |
public function __construct() { |
| 24 |
|
| 25 |
add_action( 'init', array( $this, 'set_defaults' ) ); |
| 26 |
|
| 27 |
add_action( 'init', array( $this, 'load_settings_panel' ) ); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Load the plugin's default settings |
| 32 |
* @since 1.0.0 |
| 33 |
*/ |
| 34 |
public function set_defaults() { |
| 35 |
|
| 36 |
$this->defaults = array( |
| 37 |
|
| 38 |
'timer-bar' => 'bottom', |
| 39 |
'autoplay-delay' => 6, |
| 40 |
'autoplay-interval' => 6, |
| 41 |
'transition-time' => 1, |
| 42 |
'aspect-ratio' => '16_7', |
| 43 |
'mobile-aspect-ratio' => '16_7', |
| 44 |
'arrow' => 'a', |
| 45 |
'hide-from-slider' => array(), |
| 46 |
'hide-on-mobile' => array(), |
| 47 |
); |
| 48 |
|
| 49 |
$this->defaults = apply_filters( 'ewd_us_defaults', $this->defaults ); |
| 50 |
} |
| 51 |
|
| 52 |
/** |
| 53 |
* Get a setting's value or fallback to a default if one exists |
| 54 |
* @since 1.0.0 |
| 55 |
*/ |
| 56 |
public function get_setting( $setting ) { |
| 57 |
|
| 58 |
if ( empty( $this->settings ) ) { |
| 59 |
$this->settings = get_option( 'ewd-us-settings' ); |
| 60 |
} |
| 61 |
|
| 62 |
if ( ! empty( $this->settings[ $setting ] ) or isset( $this->settings[ $setting ] ) ) { |
| 63 |
return apply_filters( 'ewd-us-settings-' . $setting, $this->settings[ $setting ] ); |
| 64 |
} |
| 65 |
|
| 66 |
if ( ! empty( $this->defaults[ $setting ] ) or isset( $this->defaults[ $setting ] ) ) { |
| 67 |
return apply_filters( 'ewd-us-settings-' . $setting, $this->defaults[ $setting ] ); |
| 68 |
} |
| 69 |
|
| 70 |
return apply_filters( 'ewd-us-settings-' . $setting, null ); |
| 71 |
} |
| 72 |
|
| 73 |
/** |
| 74 |
* Set a setting to a particular value |
| 75 |
* @since 1.0.0 |
| 76 |
*/ |
| 77 |
public function set_setting( $setting, $value ) { |
| 78 |
|
| 79 |
$this->settings[ $setting ] = $value; |
| 80 |
} |
| 81 |
|
| 82 |
/** |
| 83 |
* Save all settings, to be used with set_setting |
| 84 |
* @since 1.0.0 |
| 85 |
*/ |
| 86 |
public function save_settings() { |
| 87 |
|
| 88 |
update_option( 'ewd-us-settings', $this->settings ); |
| 89 |
} |
| 90 |
|
| 91 |
/** |
| 92 |
* Load the admin settings page |
| 93 |
* @since 1.0.0 |
| 94 |
* @sa https://github.com/NateWr/simple-admin-pages |
| 95 |
*/ |
| 96 |
public function load_settings_panel() { |
| 97 |
global $ewd_us_controller; |
| 98 |
|
| 99 |
require_once( EWD_US_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php' ); |
| 100 |
$sap = sap_initialize_library( |
| 101 |
$args = array( |
| 102 |
'version' => '2.5.3', |
| 103 |
'lib_url' => EWD_US_PLUGIN_URL . '/lib/simple-admin-pages/', |
| 104 |
) |
| 105 |
); |
| 106 |
|
| 107 |
$sap->add_page( |
| 108 |
'submenu', |
| 109 |
array( |
| 110 |
'id' => 'ewd-us-settings', |
| 111 |
'title' => __( 'Settings', 'ultimate-slider' ), |
| 112 |
'menu_title' => __( 'Settings', 'ultimate-slider' ), |
| 113 |
'parent_menu' => 'edit.php?post_type=ultimate_slider', |
| 114 |
'description' => '', |
| 115 |
'capability' => 'manage_options', |
| 116 |
'default_tab' => 'ewd-us-basic-tab', |
| 117 |
) |
| 118 |
); |
| 119 |
|
| 120 |
$sap->add_section( |
| 121 |
'ewd-us-settings', |
| 122 |
array( |
| 123 |
'id' => 'ewd-us-basic-tab', |
| 124 |
'title' => __( 'Basic', 'ultimate-slider' ), |
| 125 |
'is_tab' => true, |
| 126 |
) |
| 127 |
); |
| 128 |
|
| 129 |
$sap->add_section( |
| 130 |
'ewd-us-settings', |
| 131 |
array( |
| 132 |
'id' => 'ewd-us-basic-options', |
| 133 |
'title' => __( 'Basic Options', 'ultimate-slider' ), |
| 134 |
'tab' => 'ewd-us-basic-tab', |
| 135 |
) |
| 136 |
); |
| 137 |
|
| 138 |
$sap->add_setting( |
| 139 |
'ewd-us-settings', |
| 140 |
'ewd-us-basic-options', |
| 141 |
'warningtip', |
| 142 |
array( |
| 143 |
'id' => 'shortcodes-reminder', |
| 144 |
'title' => __( 'REMINDER:', 'ultimate-slider' ), |
| 145 |
'placeholder' => __( 'To display the slider, place the [ultimate-slider] shortcode on a page' ) |
| 146 |
) |
| 147 |
); |
| 148 |
|
| 149 |
$sap->add_setting( |
| 150 |
'ewd-us-settings', |
| 151 |
'ewd-us-basic-options', |
| 152 |
'textarea', |
| 153 |
array( |
| 154 |
'id' => 'custom-css', |
| 155 |
'title' => __( 'Custom CSS', 'ultimate-slider' ), |
| 156 |
'description' => __( 'You can add custom CSS styles to your slider in the box above.', 'ultimate-slider' ), ) |
| 157 |
); |
| 158 |
|
| 159 |
$sap->add_setting( |
| 160 |
'ewd-us-settings', |
| 161 |
'ewd-us-basic-options', |
| 162 |
'toggle', |
| 163 |
array( |
| 164 |
'id' => 'autoplay-slideshow', |
| 165 |
'title' => __( 'Autoplay Slideshow', 'ultimate-slider' ), |
| 166 |
'description' => __( 'Should the slider automatically toggle through slides?', 'ultimate-slider' ) |
| 167 |
) |
| 168 |
); |
| 169 |
|
| 170 |
$sap->add_setting( |
| 171 |
'ewd-us-settings', |
| 172 |
'ewd-us-basic-options', |
| 173 |
'count', |
| 174 |
array( |
| 175 |
'id' => 'autoplay-delay', |
| 176 |
'title' => __( 'Autoplay Delay', 'ultimate-slider' ), |
| 177 |
'description' => __( 'If autoplay is on, how many seconds should the timer wait before starting the slideshow?', 'ultimate-slider' ), |
| 178 |
'default' => $this->defaults['autoplay-delay'], |
| 179 |
'blank_option' => false, |
| 180 |
'min_value' => 1, |
| 181 |
'max_value' => 60, |
| 182 |
'increment' => 1 |
| 183 |
) |
| 184 |
); |
| 185 |
|
| 186 |
$sap->add_setting( |
| 187 |
'ewd-us-settings', |
| 188 |
'ewd-us-basic-options', |
| 189 |
'count', |
| 190 |
array( |
| 191 |
'id' => 'autoplay-interval', |
| 192 |
'title' => __( 'Autoplay Interval', 'ultimate-slider' ), |
| 193 |
'description' => __( 'If autoplay is on, how many seconds should the slideshow wait between each slide?', 'ultimate-slider' ), |
| 194 |
'default' => $this->defaults['autoplay-interval'], |
| 195 |
'blank_option' => false, |
| 196 |
'min_value' => 1, |
| 197 |
'max_value' => 60, |
| 198 |
'increment' => 1 |
| 199 |
) |
| 200 |
); |
| 201 |
|
| 202 |
$sap->add_setting( |
| 203 |
'ewd-us-settings', |
| 204 |
'ewd-us-basic-options', |
| 205 |
'toggle', |
| 206 |
array( |
| 207 |
'id' => 'autoplay-pause-hover', |
| 208 |
'title' => __( 'Pause Autoplay on Hover', 'ultimate-slider' ), |
| 209 |
'description' => __( 'Should the slider autoplay automatically pause when you hover over it?', 'ultimate-slider' ) |
| 210 |
) |
| 211 |
); |
| 212 |
|
| 213 |
$sap->add_setting( |
| 214 |
'ewd-us-settings', |
| 215 |
'ewd-us-basic-options', |
| 216 |
'count', |
| 217 |
array( |
| 218 |
'id' => 'transition-time', |
| 219 |
'title' => __( 'Slide Transition Time', 'ultimate-slider' ), |
| 220 |
'description' => __( 'How many seconds should each transition take to complete?', 'ultimate-slider' ), |
| 221 |
'default' => $this->defaults['transition-time'], |
| 222 |
'blank_option' => false, |
| 223 |
'min_value' => 1, |
| 224 |
'max_value' => 10, |
| 225 |
'increment' => 1 |
| 226 |
) |
| 227 |
); |
| 228 |
|
| 229 |
$sap->add_setting( |
| 230 |
'ewd-us-settings', |
| 231 |
'ewd-us-basic-options', |
| 232 |
'select', |
| 233 |
array( |
| 234 |
'id' => 'aspect-ratio', |
| 235 |
'title' => __( 'Aspect Ratio', 'ultimate-slider' ), |
| 236 |
'description' => '', |
| 237 |
'blank_option' => false, |
| 238 |
'default' => $this->defaults['aspect-ratio'], |
| 239 |
'options' => array( |
| 240 |
'3_1' => '3:1', |
| 241 |
'16_7' => '16:7' . __( '(default)', 'ultimate-slider' ), |
| 242 |
'2_1' => '2:1', |
| 243 |
'16_9' => '16:9', |
| 244 |
'3_2' => '3:2', |
| 245 |
'4_3' => '4:3', |
| 246 |
'1_1' => '1:1', |
| 247 |
) |
| 248 |
) |
| 249 |
); |
| 250 |
|
| 251 |
$sap->add_setting( |
| 252 |
'ewd-us-settings', |
| 253 |
'ewd-us-basic-options', |
| 254 |
'toggle', |
| 255 |
array( |
| 256 |
'id' => 'carousel', |
| 257 |
'title' => __( 'Carousel', 'ultimate-slider' ), |
| 258 |
'description' => __( 'Display a carousel slider instead of the default. The "Slide Transition Effect" setting has to be set to "Default".', 'ultimate-slider' ) |
| 259 |
) |
| 260 |
); |
| 261 |
|
| 262 |
$sap->add_setting( |
| 263 |
'ewd-us-settings', |
| 264 |
'ewd-us-basic-options', |
| 265 |
'radio', |
| 266 |
array( |
| 267 |
'id' => 'carousel-columns', |
| 268 |
'title' => __( 'Carousel Columns', 'ultimate-slider' ), |
| 269 |
'description' => __( 'Set the number of slides that should be displayed at once in carousel mode', 'ultimate-slider' ), |
| 270 |
'options' => array( |
| 271 |
2 => 2, |
| 272 |
3 => 3, |
| 273 |
4 => 4 |
| 274 |
) |
| 275 |
) |
| 276 |
); |
| 277 |
|
| 278 |
$sap->add_setting( |
| 279 |
'ewd-us-settings', |
| 280 |
'ewd-us-basic-options', |
| 281 |
'radio', |
| 282 |
array( |
| 283 |
'id' => 'timer-bar', |
| 284 |
'title' => __( 'Timer Bar', 'ultimate-slider' ), |
| 285 |
'description' => __( 'Display a timer bar at the top or bottom of your slider.', 'ultimate-slider' ), |
| 286 |
'options' => array( |
| 287 |
'top' => __( 'Top', 'ultimate-slider' ), |
| 288 |
'bottom' => __( 'Bottom', 'ultimate-slider' ), |
| 289 |
'off' => __( 'Off', 'ultimate-slider' ) |
| 290 |
) |
| 291 |
) |
| 292 |
); |
| 293 |
|
| 294 |
$sap->add_setting( |
| 295 |
'ewd-us-settings', |
| 296 |
'ewd-us-basic-options', |
| 297 |
'radio', |
| 298 |
array( |
| 299 |
'id' => 'slide-indicators', |
| 300 |
'title' => __( 'Slide Indicators', 'ultimate-slider' ), |
| 301 |
'description' => __( 'Display navigation controls to jump between slides.', 'ultimate-slider' ), |
| 302 |
'options' => array( |
| 303 |
'none' => __( 'None', 'ultimate-slider' ), |
| 304 |
'dots' => __( 'Dots', 'ultimate-slider' ), |
| 305 |
'thumbnails' => __( 'Thumbnails', 'ultimate-slider' ), |
| 306 |
'sidethumbnails' => __( 'Side Thumbnails', 'ultimate-slider' ) |
| 307 |
) |
| 308 |
) |
| 309 |
); |
| 310 |
|
| 311 |
$sap->add_setting( |
| 312 |
'ewd-us-settings', |
| 313 |
'ewd-us-basic-options', |
| 314 |
'radio', |
| 315 |
array( |
| 316 |
'id' => 'link-action', |
| 317 |
'title' => __( 'Button Link Action', 'ultimate-slider' ), |
| 318 |
'description' => __( 'Should button links open in the same or new windows? "Smart" opens external links in new windows and links on your site in the same window.', 'ultimate-slider' ), |
| 319 |
'options' => array( |
| 320 |
'same' => __( 'Same Window', 'ultimate-slider' ), |
| 321 |
'new' => __( 'New Window', 'ultimate-slider' ), |
| 322 |
'smart' => __( 'Smart', 'ultimate-slider' ) |
| 323 |
) |
| 324 |
) |
| 325 |
); |
| 326 |
|
| 327 |
if ( ! $ewd_us_controller->permissions->check_permission( 'premium' ) ) { |
| 328 |
$ewd_us_premium_permissions = array( |
| 329 |
'disabled' => true, |
| 330 |
'disabled_image'=> '#', |
| 331 |
'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-slider/' |
| 332 |
); |
| 333 |
} |
| 334 |
else { $ewd_us_premium_permissions = array(); } |
| 335 |
|
| 336 |
$sap->add_section( |
| 337 |
'ewd-us-settings', |
| 338 |
array( |
| 339 |
'id' => 'ewd-us-premium-tab', |
| 340 |
'title' => __( 'Premium', 'ultimate-slider' ), |
| 341 |
'is_tab' => true, |
| 342 |
) |
| 343 |
); |
| 344 |
|
| 345 |
$sap->add_section( |
| 346 |
'ewd-us-settings', |
| 347 |
array_merge( |
| 348 |
array( |
| 349 |
'id' => 'ewd-us-premium-options', |
| 350 |
'title' => __( 'Premium Options', 'ultimate-slider' ), |
| 351 |
'tab' => 'ewd-us-premium-tab', |
| 352 |
), |
| 353 |
$ewd_us_premium_permissions |
| 354 |
) |
| 355 |
); |
| 356 |
|
| 357 |
$sap->add_setting( |
| 358 |
'ewd-us-settings', |
| 359 |
'ewd-us-premium-options', |
| 360 |
'radio', |
| 361 |
array( |
| 362 |
'id' => 'slide-transition-effect', |
| 363 |
'title' => __( 'Slide Transition Effect', 'ultimate-slider' ), |
| 364 |
'description' => __( 'Which effect should be used to transition between slides?', 'ultimate-slider' ), |
| 365 |
'options' => array( |
| 366 |
'slide' => __( 'Default', 'ultimate-slider' ), |
| 367 |
'fade' => __( 'Fade', 'ultimate-slider' ), |
| 368 |
'slide-up' => __( 'Slide Up', 'ultimate-slider' ), |
| 369 |
'slide-down' => __( 'Slide Down', 'ultimate-slider' ), |
| 370 |
'stretch-right' => __( 'Stretch Right', 'ultimate-slider' ), |
| 371 |
'stretch-left' => __( 'Stretch Left', 'ultimate-slider' ), |
| 372 |
'grow' => __( 'Grow', 'ultimate-slider' ), |
| 373 |
'expand' => __( 'Expand', 'ultimate-slider' ), |
| 374 |
) |
| 375 |
) |
| 376 |
); |
| 377 |
|
| 378 |
$sap->add_setting( |
| 379 |
'ewd-us-settings', |
| 380 |
'ewd-us-premium-options', |
| 381 |
'toggle', |
| 382 |
array( |
| 383 |
'id' => 'wc-product-image-slider', |
| 384 |
'title' => __( 'WooCommerce Product Image Slider', 'ultimate-slider' ), |
| 385 |
'description' => __( 'Should the WooCommerce product page image be converted into a slider when there\'s more than one image? (Might require changing the "Aspect Ratio" setting for the slider, depending on the theme you\'re using)', 'ultimate-slider' ) |
| 386 |
) |
| 387 |
); |
| 388 |
|
| 389 |
$sap->add_setting( |
| 390 |
'ewd-us-settings', |
| 391 |
'ewd-us-premium-options', |
| 392 |
'select', |
| 393 |
array( |
| 394 |
'id' => 'mobile-aspect-ratio', |
| 395 |
'title' => __( 'Mobile Aspect Ratio', 'ultimate-slider' ), |
| 396 |
'description' => __( 'What should the aspect ratio of the slider be on smaller screens?', 'ultimate-slider' ), |
| 397 |
'blank_option' => false, |
| 398 |
'default' => $this->defaults['mobile-aspect-ratio'], |
| 399 |
'options' => array( |
| 400 |
'3_1' => '3:1', |
| 401 |
'16_7' => '16:7' . __( '(default)', 'ultimate-slider' ), |
| 402 |
'2_1' => '2:1', |
| 403 |
'16_9' => '16:9', |
| 404 |
'3_2' => '3:2', |
| 405 |
'4_3' => '4:3', |
| 406 |
'1_1' => '1:1', |
| 407 |
) |
| 408 |
) |
| 409 |
); |
| 410 |
|
| 411 |
$sap->add_setting( |
| 412 |
'ewd-us-settings', |
| 413 |
'ewd-us-premium-options', |
| 414 |
'checkbox', |
| 415 |
array( |
| 416 |
'id' => 'hide-from-slider', |
| 417 |
'title' => __( 'Hide Elements from Slider', 'ultimate-slider' ), |
| 418 |
'description' => __( 'Hide specific elements of the slider.', 'ultimate-slider' ), |
| 419 |
'options' => array( |
| 420 |
'title' => 'Title', |
| 421 |
'body' => 'Body', |
| 422 |
'buttons' => 'Buttons', |
| 423 |
'arrows' => 'Arrows', |
| 424 |
) |
| 425 |
) |
| 426 |
); |
| 427 |
|
| 428 |
$sap->add_setting( |
| 429 |
'ewd-us-settings', |
| 430 |
'ewd-us-premium-options', |
| 431 |
'checkbox', |
| 432 |
array( |
| 433 |
'id' => 'hide-on-mobile', |
| 434 |
'title' => __( 'Hide Elements from Mobile View', 'ultimate-slider' ), |
| 435 |
'description' => __( 'Hide elements just from the mobile view.', 'ultimate-slider' ), |
| 436 |
'options' => array( |
| 437 |
'title' => 'Title', |
| 438 |
'body' => 'Body', |
| 439 |
'buttons' => 'Buttons', |
| 440 |
'arrows' => 'Arrows', |
| 441 |
'thumbnails' => 'Thumbnails', |
| 442 |
) |
| 443 |
) |
| 444 |
); |
| 445 |
|
| 446 |
$sap->add_setting( |
| 447 |
'ewd-us-settings', |
| 448 |
'ewd-us-premium-options', |
| 449 |
'toggle', |
| 450 |
array( |
| 451 |
'id' => 'mobile-link-to-full', |
| 452 |
'title' => __( 'Mobile Link to Full Post?', 'ultimate-slider' ), |
| 453 |
'description' => __( 'Should clicking on a slide bring up the individual slide post on mobile?', 'ultimate-slider' ) |
| 454 |
) |
| 455 |
); |
| 456 |
|
| 457 |
$sap->add_setting( |
| 458 |
'ewd-us-settings', |
| 459 |
'ewd-us-premium-options', |
| 460 |
'radio', |
| 461 |
array( |
| 462 |
'id' => 'title-animate', |
| 463 |
'title' => __( 'Title Animation', 'ultimate-slider' ), |
| 464 |
'description' => '', |
| 465 |
'options' => array( |
| 466 |
'none' => __( 'None', 'ultimate-slider' ), |
| 467 |
'slidefromleft' => __( 'Slide From Left', 'ultimate-slider' ), |
| 468 |
'slidefromright' => __( 'Slide From Right', 'ultimate-slider' ), |
| 469 |
'fadein' => __( 'Fade In', 'ultimate-slider' ), |
| 470 |
'scrolldown' => __( 'Scroll Down', 'ultimate-slider' ), |
| 471 |
) |
| 472 |
) |
| 473 |
); |
| 474 |
|
| 475 |
$sap->add_setting( |
| 476 |
'ewd-us-settings', |
| 477 |
'ewd-us-premium-options', |
| 478 |
'toggle', |
| 479 |
array( |
| 480 |
'id' => 'force-full-width', |
| 481 |
'title' => __( 'Force Full Width', 'ultimate-slider' ), |
| 482 |
'description' => __( 'Force the slider to go the full width of the window, regardless of the container it\'s in.', 'ultimate-slider' ) |
| 483 |
) |
| 484 |
); |
| 485 |
|
| 486 |
$sap->add_setting( |
| 487 |
'ewd-us-settings', |
| 488 |
'ewd-us-premium-options', |
| 489 |
'toggle', |
| 490 |
array( |
| 491 |
'id' => 'add-watermark', |
| 492 |
'title' => __( 'Add Watermark', 'ultimate-slider' ), |
| 493 |
'description' => __( 'Should a watermark be added to each image? Requires GD PHP module to be installed on your server.', 'ultimate-slider' ) |
| 494 |
) |
| 495 |
); |
| 496 |
|
| 497 |
$sap->add_setting( |
| 498 |
'ewd-us-settings', |
| 499 |
'ewd-us-premium-options', |
| 500 |
'toggle', |
| 501 |
array( |
| 502 |
'id' => 'lightbox', |
| 503 |
'title' => __( 'Lightbox on Image Click', 'ultimate-slider' ), |
| 504 |
'description' => __( 'Should a lightbox be opened when an image is clicked on? Particularly useful if you\'re using carousel mode. Want to customize this lightbox? Install the "Ultimate Lightbox" plugin , and you can switch the lightbox colors, controls, behaviour and more. It\'s free!', 'ultimate-slider' ) |
| 505 |
) |
| 506 |
); |
| 507 |
|
| 508 |
if ( ! $ewd_us_controller->permissions->check_permission( 'youtube' ) ) { |
| 509 |
$ewd_us_youtube_permissions = array( |
| 510 |
'disabled' => true, |
| 511 |
'disabled_image'=> '#', |
| 512 |
'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-slider/' |
| 513 |
); |
| 514 |
} |
| 515 |
else { $ewd_us_youtube_permissions = array(); } |
| 516 |
|
| 517 |
$sap->add_section( |
| 518 |
'ewd-us-settings', |
| 519 |
array_merge( |
| 520 |
array( |
| 521 |
'id' => 'ewd-us-youtube-options', |
| 522 |
'title' => __( 'YouTube Slide Options', 'ultimate-slider' ), |
| 523 |
'tab' => 'ewd-us-premium-tab', |
| 524 |
), |
| 525 |
$ewd_us_youtube_permissions |
| 526 |
) |
| 527 |
); |
| 528 |
|
| 529 |
$sap->add_setting( |
| 530 |
'ewd-us-settings', |
| 531 |
'ewd-us-youtube-options', |
| 532 |
'toggle', |
| 533 |
array( |
| 534 |
'id' => 'youtube-autoplay-video', |
| 535 |
'title' => __( 'Autoplay Video', 'ultimate-slider' ), |
| 536 |
'description' => __( 'Should the video automatically start playing on page load?', 'ultimate-slider' ) |
| 537 |
) |
| 538 |
); |
| 539 |
|
| 540 |
$sap->add_setting( |
| 541 |
'ewd-us-settings', |
| 542 |
'ewd-us-youtube-options', |
| 543 |
'toggle', |
| 544 |
array( |
| 545 |
'id' => 'youtube-show-content', |
| 546 |
'title' => __( 'Show Slide Content', 'ultimate-slider' ), |
| 547 |
'description' => __( 'Enabling this will overlay the slide content on top of the video. Disable it to only show the video.', 'ultimate-slider' ) |
| 548 |
) |
| 549 |
); |
| 550 |
|
| 551 |
$sap->add_setting( |
| 552 |
'ewd-us-settings', |
| 553 |
'ewd-us-youtube-options', |
| 554 |
'text', |
| 555 |
array( |
| 556 |
'id' => 'youtube-video-opacity', |
| 557 |
'title' => __( 'Video Opacity', 'ultimate-slider' ), |
| 558 |
'description' => __( 'This lets you set the opacity of the video, which can help if you have the content enabled above. (Examples would be 0, 0.5 or 1.)', 'ultimate-slider' ), |
| 559 |
'small' => true |
| 560 |
) |
| 561 |
); |
| 562 |
|
| 563 |
if ( ! $ewd_us_controller->permissions->check_permission( 'styling' ) ) { |
| 564 |
$ewd_us_styling_permissions = array( |
| 565 |
'disabled' => true, |
| 566 |
'disabled_image'=> '#', |
| 567 |
'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-slider/' |
| 568 |
); |
| 569 |
} |
| 570 |
else { $ewd_us_styling_permissions = array(); } |
| 571 |
|
| 572 |
$sap->add_section( |
| 573 |
'ewd-us-settings', |
| 574 |
array( |
| 575 |
'id' => 'ewd-us-styling-tab', |
| 576 |
'title' => __( 'Styling', 'ultimate-slider' ), |
| 577 |
'is_tab' => true, |
| 578 |
) |
| 579 |
); |
| 580 |
|
| 581 |
$sap->add_section( |
| 582 |
'ewd-us-settings', |
| 583 |
array_merge( |
| 584 |
array( |
| 585 |
'id' => 'ewd-us-slide-title-options', |
| 586 |
'title' => __( 'Slide Title Options', 'ultimate-slider' ), |
| 587 |
'tab' => 'ewd-us-styling-tab', |
| 588 |
), |
| 589 |
$ewd_us_styling_permissions |
| 590 |
) |
| 591 |
); |
| 592 |
|
| 593 |
$sap->add_setting( |
| 594 |
'ewd-us-settings', |
| 595 |
'ewd-us-slide-title-options', |
| 596 |
'colorpicker', |
| 597 |
array( |
| 598 |
'id' => 'styling-slide-title-font-color', |
| 599 |
'title' => __( 'Color', 'ultimate-slider' ) |
| 600 |
) |
| 601 |
); |
| 602 |
|
| 603 |
$sap->add_setting( |
| 604 |
'ewd-us-settings', |
| 605 |
'ewd-us-slide-title-options', |
| 606 |
'text', |
| 607 |
array( |
| 608 |
'id' => 'styling-slide-title-font', |
| 609 |
'title' => __( 'Font Family', 'ultimate-slider' ), |
| 610 |
'small' => true |
| 611 |
) |
| 612 |
); |
| 613 |
|
| 614 |
$sap->add_setting( |
| 615 |
'ewd-us-settings', |
| 616 |
'ewd-us-slide-title-options', |
| 617 |
'text', |
| 618 |
array( |
| 619 |
'id' => 'styling-slide-title-font-size', |
| 620 |
'title' => __( 'Font Size', 'ultimate-slider' ), |
| 621 |
'small' => true |
| 622 |
) |
| 623 |
); |
| 624 |
|
| 625 |
$sap->add_section( |
| 626 |
'ewd-us-settings', |
| 627 |
array_merge( |
| 628 |
array( |
| 629 |
'id' => 'ewd-us-slide-text-options', |
| 630 |
'title' => __( 'Slide Text Options', 'ultimate-slider' ), |
| 631 |
'tab' => 'ewd-us-styling-tab', |
| 632 |
), |
| 633 |
$ewd_us_styling_permissions |
| 634 |
) |
| 635 |
); |
| 636 |
|
| 637 |
$sap->add_setting( |
| 638 |
'ewd-us-settings', |
| 639 |
'ewd-us-slide-text-options', |
| 640 |
'colorpicker', |
| 641 |
array( |
| 642 |
'id' => 'styling-slide-text-font-color', |
| 643 |
'title' => __( 'Color', 'ultimate-slider' ) |
| 644 |
) |
| 645 |
); |
| 646 |
|
| 647 |
$sap->add_setting( |
| 648 |
'ewd-us-settings', |
| 649 |
'ewd-us-slide-text-options', |
| 650 |
'text', |
| 651 |
array( |
| 652 |
'id' => 'styling-slide-text-font', |
| 653 |
'title' => __( 'Font Family', 'ultimate-slider' ), |
| 654 |
'small' => true |
| 655 |
) |
| 656 |
); |
| 657 |
|
| 658 |
$sap->add_setting( |
| 659 |
'ewd-us-settings', |
| 660 |
'ewd-us-slide-text-options', |
| 661 |
'text', |
| 662 |
array( |
| 663 |
'id' => 'styling-slide-text-font-size', |
| 664 |
'title' => __( 'Font Size', 'ultimate-slider' ), |
| 665 |
'small' => true |
| 666 |
) |
| 667 |
); |
| 668 |
|
| 669 |
$sap->add_section( |
| 670 |
'ewd-us-settings', |
| 671 |
array_merge( |
| 672 |
array( |
| 673 |
'id' => 'ewd-us-slide-button-options', |
| 674 |
'title' => __( 'Slide Button Options', 'ultimate-slider' ), |
| 675 |
'tab' => 'ewd-us-styling-tab', |
| 676 |
), |
| 677 |
$ewd_us_styling_permissions |
| 678 |
) |
| 679 |
); |
| 680 |
|
| 681 |
$sap->add_setting( |
| 682 |
'ewd-us-settings', |
| 683 |
'ewd-us-slide-button-options', |
| 684 |
'colorpicker', |
| 685 |
array( |
| 686 |
'id' => 'styling-button-background-color', |
| 687 |
'title' => __( 'Background Color', 'ultimate-slider' ) |
| 688 |
) |
| 689 |
); |
| 690 |
|
| 691 |
$sap->add_setting( |
| 692 |
'ewd-us-settings', |
| 693 |
'ewd-us-slide-button-options', |
| 694 |
'colorpicker', |
| 695 |
array( |
| 696 |
'id' => 'styling-button-background-hover-color', |
| 697 |
'title' => __( 'Background Hover Color', 'ultimate-slider' ) |
| 698 |
) |
| 699 |
); |
| 700 |
|
| 701 |
$sap->add_setting( |
| 702 |
'ewd-us-settings', |
| 703 |
'ewd-us-slide-button-options', |
| 704 |
'colorpicker', |
| 705 |
array( |
| 706 |
'id' => 'styling-button-border-color', |
| 707 |
'title' => __( 'Border Color', 'ultimate-slider' ) |
| 708 |
) |
| 709 |
); |
| 710 |
|
| 711 |
$sap->add_setting( |
| 712 |
'ewd-us-settings', |
| 713 |
'ewd-us-slide-button-options', |
| 714 |
'colorpicker', |
| 715 |
array( |
| 716 |
'id' => 'styling-button-border-hover-color', |
| 717 |
'title' => __( 'Border Hover Color', 'ultimate-slider' ) |
| 718 |
) |
| 719 |
); |
| 720 |
|
| 721 |
$sap->add_setting( |
| 722 |
'ewd-us-settings', |
| 723 |
'ewd-us-slide-button-options', |
| 724 |
'colorpicker', |
| 725 |
array( |
| 726 |
'id' => 'styling-button-text-color', |
| 727 |
'title' => __( 'Text Color', 'ultimate-slider' ) |
| 728 |
) |
| 729 |
); |
| 730 |
|
| 731 |
$sap->add_setting( |
| 732 |
'ewd-us-settings', |
| 733 |
'ewd-us-slide-button-options', |
| 734 |
'colorpicker', |
| 735 |
array( |
| 736 |
'id' => 'styling-button-text-hover-color', |
| 737 |
'title' => __( 'Text Hover Color', 'ultimate-slider' ) |
| 738 |
) |
| 739 |
); |
| 740 |
|
| 741 |
if ( ! $ewd_us_controller->permissions->check_permission( 'controls' ) ) { |
| 742 |
$ewd_us_controls_permissions = array( |
| 743 |
'disabled' => true, |
| 744 |
'disabled_image'=> '#', |
| 745 |
'purchase_link' => 'https://www.etoilewebdesign.com/plugins/ultimate-slider/' |
| 746 |
); |
| 747 |
} |
| 748 |
else { $ewd_us_controls_permissions = array(); } |
| 749 |
|
| 750 |
$sap->add_section( |
| 751 |
'ewd-us-settings', |
| 752 |
array( |
| 753 |
'id' => 'ewd-us-controls-tab', |
| 754 |
'title' => __( 'Controls', 'ultimate-slider' ), |
| 755 |
'is_tab' => true, |
| 756 |
) |
| 757 |
); |
| 758 |
|
| 759 |
$sap->add_section( |
| 760 |
'ewd-us-settings', |
| 761 |
array_merge( |
| 762 |
array( |
| 763 |
'id' => 'ewd-us-control-options', |
| 764 |
'title' => __( 'Control Options', 'ultimate-slider' ), |
| 765 |
'tab' => 'ewd-us-controls-tab', |
| 766 |
), |
| 767 |
$ewd_us_controls_permissions |
| 768 |
) |
| 769 |
); |
| 770 |
|
| 771 |
$sap->add_setting( |
| 772 |
'ewd-us-settings', |
| 773 |
'ewd-us-control-options', |
| 774 |
'radio', |
| 775 |
array( |
| 776 |
'id' => 'arrow', |
| 777 |
'title' => __( 'Arrows', 'ultimate-slider' ), |
| 778 |
'columns' => '3', |
| 779 |
'options' => array( |
| 780 |
'none' => __( 'No Arrow', 'ultimate-slider' ), |
| 781 |
'a' => '<span class="ewd-us-arrow">b</span>', |
| 782 |
'c' => '<span class="ewd-us-arrow">d</span>', |
| 783 |
'e' => '<span class="ewd-us-arrow">f</span>', |
| 784 |
'g' => '<span class="ewd-us-arrow">h</span>', |
| 785 |
'i' => '<span class="ewd-us-arrow">j</span>', |
| 786 |
'k' => '<span class="ewd-us-arrow">l</span>', |
| 787 |
'm' => '<span class="ewd-us-arrow">n</span>', |
| 788 |
'o' => '<span class="ewd-us-arrow">p</span>', |
| 789 |
'q' => '<span class="ewd-us-arrow">r</span>', |
| 790 |
'A' => '<span class="ewd-us-arrow">B</span>', |
| 791 |
'E' => '<span class="ewd-us-arrow">D</span>', |
| 792 |
'G' => '<span class="ewd-us-arrow">F</span>', |
| 793 |
'I' => '<span class="ewd-us-arrow">J</span>', |
| 794 |
'K' => '<span class="ewd-us-arrow">L</span>', |
| 795 |
'M' => '<span class="ewd-us-arrow">N</span>', |
| 796 |
'O' => '<span class="ewd-us-arrow">P</span>', |
| 797 |
'Q' => '<span class="ewd-us-arrow">R</span>', |
| 798 |
) |
| 799 |
) |
| 800 |
); |
| 801 |
|
| 802 |
$sap->add_setting( |
| 803 |
'ewd-us-settings', |
| 804 |
'ewd-us-control-options', |
| 805 |
'radio', |
| 806 |
array( |
| 807 |
'id' => 'arrow-background-shape', |
| 808 |
'title' => __( 'Background Shape', 'ultimate-slider' ), |
| 809 |
'description' => '', |
| 810 |
'options' => array( |
| 811 |
'none' => __( 'No Background', 'ultimate-slider' ), |
| 812 |
'square' => __( 'Square', 'ultimate-slider' ), |
| 813 |
'circle' => __( 'Circle', 'ultimate-slider' ), |
| 814 |
'diamond' => __( 'Diamond', 'ultimate-slider' ), |
| 815 |
) |
| 816 |
) |
| 817 |
); |
| 818 |
|
| 819 |
$sap->add_setting( |
| 820 |
'ewd-us-settings', |
| 821 |
'ewd-us-control-options', |
| 822 |
'colorpicker', |
| 823 |
array( |
| 824 |
'id' => 'styling-arrow-color', |
| 825 |
'title' => __( 'Arrow Color', 'ultimate-slider' ) |
| 826 |
) |
| 827 |
); |
| 828 |
|
| 829 |
$sap->add_setting( |
| 830 |
'ewd-us-settings', |
| 831 |
'ewd-us-control-options', |
| 832 |
'colorpicker', |
| 833 |
array( |
| 834 |
'id' => 'styling-arrow-background-color', |
| 835 |
'title' => __( 'Arrow Background Color', 'ultimate-slider' ) |
| 836 |
) |
| 837 |
); |
| 838 |
|
| 839 |
$sap->add_setting( |
| 840 |
'ewd-us-settings', |
| 841 |
'ewd-us-control-options', |
| 842 |
'colorpicker', |
| 843 |
array( |
| 844 |
'id' => 'styling-clickable-area-background-color', |
| 845 |
'title' => __( 'Clickable Area Color', 'ultimate-slider' ) |
| 846 |
) |
| 847 |
); |
| 848 |
|
| 849 |
$sap->add_setting( |
| 850 |
'ewd-us-settings', |
| 851 |
'ewd-us-control-options', |
| 852 |
'text', |
| 853 |
array( |
| 854 |
'id' => 'styling-arrow-font-size', |
| 855 |
'title' => __( 'Arrow Size', 'ultimate-slider' ), |
| 856 |
'small' => true |
| 857 |
) |
| 858 |
); |
| 859 |
|
| 860 |
$sap->add_setting( |
| 861 |
'ewd-us-settings', |
| 862 |
'ewd-us-control-options', |
| 863 |
'text', |
| 864 |
array( |
| 865 |
'id' => 'styling-arrow-background-size', |
| 866 |
'title' => __( 'Arrow Background Size', 'ultimate-slider' ), |
| 867 |
'small' => true |
| 868 |
) |
| 869 |
); |
| 870 |
|
| 871 |
$sap->add_setting( |
| 872 |
'ewd-us-settings', |
| 873 |
'ewd-us-control-options', |
| 874 |
'text', |
| 875 |
array( |
| 876 |
'id' => 'styling-clickable-area-size', |
| 877 |
'title' => __( 'Clickable Area Size', 'ultimate-slider' ), |
| 878 |
'small' => true |
| 879 |
) |
| 880 |
); |
| 881 |
|
| 882 |
$sap->add_setting( |
| 883 |
'ewd-us-settings', |
| 884 |
'ewd-us-control-options', |
| 885 |
'text', |
| 886 |
array( |
| 887 |
'id' => 'styling-arrow-line-height', |
| 888 |
'title' => __( 'Line Height of Arrow Within Background (ex. "1.25")', 'ultimate-slider' ), |
| 889 |
'small' => true |
| 890 |
) |
| 891 |
); |
| 892 |
|
| 893 |
$sap = apply_filters( 'ewd_us_settings_page', $sap ); |
| 894 |
|
| 895 |
$sap->add_admin_menus(); |
| 896 |
|
| 897 |
} |
| 898 |
|
| 899 |
} |
| 900 |
} // endif; |
| 901 |
|