Embedpress_Calendar.php
1 year ago
Embedpress_Document.php
1 year ago
Embedpress_Elementor.php
1 year ago
Embedpress_Pdf.php
1 year ago
Embedpress_Elementor.php
4346 lines
| 1 | <?php |
| 2 | |
| 3 | namespace EmbedPress\Elementor\Widgets; |
| 4 | |
| 5 | |
| 6 | use Elementor\Controls_Manager as Controls_Manager; |
| 7 | |
| 8 | use Elementor\Plugin; |
| 9 | use Elementor\Widget_Base as Widget_Base; |
| 10 | use EmbedPress\Includes\Classes\Helper; |
| 11 | use EmbedPress\Includes\Traits\Branding; |
| 12 | use EmbedPress\Shortcode; |
| 13 | |
| 14 | (defined('ABSPATH')) or die("No direct script access allowed."); |
| 15 | |
| 16 | class Embedpress_Elementor extends Widget_Base |
| 17 | { |
| 18 | |
| 19 | use Branding; |
| 20 | protected $pro_class = ''; |
| 21 | protected $pro_text = ''; |
| 22 | protected $pro_label = ''; |
| 23 | public function get_name() |
| 24 | { |
| 25 | return 'embedpres_elementor'; |
| 26 | } |
| 27 | |
| 28 | public function get_title() |
| 29 | { |
| 30 | return esc_html__('EmbedPress', 'embedpress'); |
| 31 | } |
| 32 | |
| 33 | public function get_categories() |
| 34 | { |
| 35 | return ['embedpress']; |
| 36 | } |
| 37 | |
| 38 | public function get_custom_help_url() |
| 39 | { |
| 40 | return 'https://embedpress.com/documentation'; |
| 41 | } |
| 42 | |
| 43 | public function get_icon() |
| 44 | { |
| 45 | return 'icon-embedpress'; |
| 46 | } |
| 47 | |
| 48 | public function get_style_depends() { |
| 49 | $handler_keys = get_option('enabled_elementor_scripts', []); |
| 50 | |
| 51 | $handles = []; |
| 52 | |
| 53 | if (isset($handler_keys['enabled_custom_player']) && $handler_keys['enabled_custom_player'] === 'yes') { |
| 54 | $handles[] = 'plyr'; |
| 55 | } |
| 56 | if (isset($handler_keys['enabled_instafeed']) && $handler_keys['enabled_instafeed'] === 'yes') { |
| 57 | $handles[] = 'cg-carousel'; |
| 58 | } |
| 59 | |
| 60 | $handles[] = 'embedpress-elementor-css'; |
| 61 | $handles[] = 'embedpress-style'; |
| 62 | |
| 63 | |
| 64 | return $handles; |
| 65 | } |
| 66 | |
| 67 | |
| 68 | |
| 69 | public function get_script_depends() |
| 70 | { |
| 71 | $handler_keys = get_option('enabled_elementor_scripts', []); |
| 72 | |
| 73 | $handles = []; |
| 74 | |
| 75 | if (isset($handler_keys['enabled_custom_player']) && $handler_keys['enabled_custom_player'] === 'yes') { |
| 76 | $handles[] = 'plyr.polyfilled'; |
| 77 | $handles[] = 'initplyr'; |
| 78 | $handles[] = 'vimeo-player'; |
| 79 | } |
| 80 | $handles[] = 'embedpress-front'; |
| 81 | |
| 82 | if (isset($handler_keys['enabled_ads']) && $handler_keys['enabled_ads'] === 'yes') { |
| 83 | $handles[] = 'embedpress-ads'; |
| 84 | } |
| 85 | |
| 86 | if (isset($handler_keys['enabled_instafeed']) && $handler_keys['enabled_instafeed'] === 'yes') { |
| 87 | $handles[] = 'cg-carousel'; |
| 88 | } |
| 89 | |
| 90 | return $handles; |
| 91 | } |
| 92 | |
| 93 | |
| 94 | /** |
| 95 | * Get widget keywords. |
| 96 | * |
| 97 | * Retrieve the list of keywords the widget belongs to. |
| 98 | * |
| 99 | * @return array Widget keywords. |
| 100 | * @since 2.4.1 |
| 101 | * @access public |
| 102 | * |
| 103 | */ |
| 104 | public function get_keywords() |
| 105 | { |
| 106 | return [ |
| 107 | 'embedpress', |
| 108 | 'audio', |
| 109 | 'video', |
| 110 | 'map', |
| 111 | 'youtube', |
| 112 | 'vimeo', |
| 113 | 'wistia', |
| 114 | 'twitch', |
| 115 | 'soundcloud', |
| 116 | 'giphy gifs', |
| 117 | 'spotify', |
| 118 | 'smugmug', |
| 119 | 'meetup', |
| 120 | 'apple', |
| 121 | 'apple podcast', |
| 122 | 'podcast', |
| 123 | 'dailymotion', |
| 124 | 'instagram', |
| 125 | 'slideshare', |
| 126 | 'flickr', |
| 127 | 'ted', |
| 128 | 'google docs', |
| 129 | 'google slides', |
| 130 | 'google drawings' |
| 131 | ]; |
| 132 | } |
| 133 | |
| 134 | |
| 135 | |
| 136 | protected function register_controls() |
| 137 | { |
| 138 | $class = 'embedpress-pro-control not-active'; |
| 139 | $text = '<sup class="embedpress-pro-label" style="color:red">' . __('Pro', 'embedpress') . '</sup>'; |
| 140 | $label = '(pro)'; |
| 141 | $this->pro_class = apply_filters('embedpress/pro_class', $class); |
| 142 | $this->pro_label = apply_filters('embedpress/pro_label', $label); |
| 143 | $this->pro_text = apply_filters('embedpress/pro_text', $text); |
| 144 | |
| 145 | /** |
| 146 | * EmbedPress General Settings |
| 147 | */ |
| 148 | $this->start_controls_section( |
| 149 | 'embedpress_elementor_content_settings', |
| 150 | [ |
| 151 | 'label' => esc_html__('General', 'embedpress'), |
| 152 | ] |
| 153 | ); |
| 154 | |
| 155 | $this->add_control( |
| 156 | 'instafeed_access_token_notice', |
| 157 | [ |
| 158 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 159 | 'raw' => sprintf('%s <a href="%s" target="_blank">here</a>.', |
| 160 | esc_html__('To enable full Instagram embedding experience, please add your access token ', 'embedpress'), |
| 161 | esc_url(admin_url('/admin.php?page=embedpress&page_type=instagram')) |
| 162 | ), |
| 163 | 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info', |
| 164 | 'condition' => [ |
| 165 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 166 | ], |
| 167 | ] |
| 168 | ); |
| 169 | |
| 170 | |
| 171 | |
| 172 | do_action('embedpress/embeded/extend', $this); |
| 173 | $this->add_control( |
| 174 | 'embedpress_pro_embeded_source', |
| 175 | [ |
| 176 | 'label' => __('Source Name', 'embedpress'), |
| 177 | 'type' => Controls_Manager::SELECT2, |
| 178 | 'label_block' => false, |
| 179 | 'default' => 'default', |
| 180 | 'options' => [ |
| 181 | 'default' => __('Default', 'embedpress'), |
| 182 | 'youtube' => __('YouTube', 'embedpress'), |
| 183 | 'vimeo' => __('Vimeo', 'embedpress'), |
| 184 | 'instafeed' => __('Instagram Feed', 'embedpress'), |
| 185 | 'twitch' => __('Twitch', 'embedpress'), |
| 186 | 'soundcloud' => __('SoundCloud', 'embedpress'), |
| 187 | 'dailymotion' => __('Dailymotion', 'embedpress'), |
| 188 | 'wistia' => __('Wistia', 'embedpress'), |
| 189 | 'calendly' => __('Calendly', 'embedpress'), |
| 190 | 'opensea' => __('OpenSea', 'embedpress'), |
| 191 | 'spreaker' => __('Spreaker', 'embedpress'), |
| 192 | 'selfhosted_video' => __('Self-hosted Video', 'embedpress'), |
| 193 | 'selfhosted_audio' => __('Self-hosted Audio', 'embedpress'), |
| 194 | ] |
| 195 | |
| 196 | ] |
| 197 | ); |
| 198 | |
| 199 | |
| 200 | $this->add_control( |
| 201 | 'instafeedFeedType', |
| 202 | [ |
| 203 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 204 | 'label' => esc_html__( 'Feed Type', 'embedpress' ), |
| 205 | 'options' => [ |
| 206 | 'user_account_type' => esc_html__( 'User Account', 'embedpress' ), |
| 207 | 'hashtag_type' => sprintf(__('Hashtag%s', 'embedpress'), $this->pro_label), |
| 208 | 'tagged_type' => esc_html__( 'Tagged(Coming Soon)', 'embedpress' ), |
| 209 | 'mixed_type' => esc_html__( 'Mixed(Coming Soon)', 'embedpress' ), |
| 210 | ], |
| 211 | 'default' => 'user_account_type', |
| 212 | 'condition' => [ |
| 213 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 214 | ] |
| 215 | ] |
| 216 | ); |
| 217 | |
| 218 | if ( !apply_filters('embedpress/is_allow_rander', false) ) { |
| 219 | $this->add_control( |
| 220 | 'embedpress_insta_layout__pro_enable_warning_1', |
| 221 | [ |
| 222 | 'label' => sprintf( '<a style="color: red" target="_blank" href="https://wpdeveloper.com/in/upgrade-embedpress">%s</a>', |
| 223 | esc_html__( 'Only Available in Pro Version!', 'essential-addons-for-elementor-lite' ) ), |
| 224 | 'type' => Controls_Manager::RAW_HTML, |
| 225 | 'condition' => [ |
| 226 | 'instafeedFeedType' => [ 'hashtag_type'], |
| 227 | ], |
| 228 | ] |
| 229 | ); |
| 230 | } |
| 231 | |
| 232 | $this->add_control( |
| 233 | 'instafeedAccountType', |
| 234 | [ |
| 235 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 236 | 'label' => esc_html__( 'Account Type', 'embedpress' ), |
| 237 | 'options' => [ |
| 238 | 'personal' => esc_html__( 'Personal', 'embedpress' ), |
| 239 | 'business' => esc_html__( 'Business', 'embedpress' ), |
| 240 | ], |
| 241 | 'default' => 'personal', |
| 242 | 'condition' => [ |
| 243 | 'instafeedFeedType' => 'user_account_type', |
| 244 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 245 | ] |
| 246 | ] |
| 247 | ); |
| 248 | |
| 249 | $this->add_control( |
| 250 | 'instafeed_feed_type_important_note', |
| 251 | [ |
| 252 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 253 | 'raw' => 'To embed #hashtag posts you need to connect bussiness account. <a href="'.esc_url('https://embedpress.com/docs/generate-instagram-access-token/').'">Learn More</a>', |
| 254 | 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info', |
| 255 | 'condition' => [ |
| 256 | 'instafeedFeedType' => 'hashtag_type', |
| 257 | ], |
| 258 | ] |
| 259 | ); |
| 260 | |
| 261 | $this->add_control( |
| 262 | 'embedpress_pro_embeded_nft_type', |
| 263 | [ |
| 264 | 'label' => __('Type', 'embedpress'), |
| 265 | 'type' => Controls_Manager::SELECT, |
| 266 | 'label_block' => false, |
| 267 | 'default' => 'collection', |
| 268 | 'options' => [ |
| 269 | 'collection' => __('Assets Collection', 'embedpress'), |
| 270 | 'single' => __('Single Asset', 'embedpress'), |
| 271 | ], |
| 272 | 'condition' => [ |
| 273 | 'embedpress_pro_embeded_source' => 'opensea' |
| 274 | ] |
| 275 | ] |
| 276 | ); |
| 277 | |
| 278 | $this->add_control( |
| 279 | 'embedpress_embeded_link', |
| 280 | [ |
| 281 | |
| 282 | 'label' => __('Embedded Link', 'embedpress'), |
| 283 | 'type' => Controls_Manager::TEXT, |
| 284 | 'dynamic' => [ |
| 285 | 'active' => true, |
| 286 | ], |
| 287 | 'placeholder' => __('Enter your Link', 'embedpress'), |
| 288 | 'label_block' => true, |
| 289 | 'ai' => [ |
| 290 | 'active' => false, |
| 291 | ], |
| 292 | 'condition' => [ |
| 293 | 'instafeedAccountType!' => 'hashtag' |
| 294 | ] |
| 295 | |
| 296 | ] |
| 297 | ); |
| 298 | |
| 299 | $this->add_control( |
| 300 | 'embedpress_audio_video_auto_pause', |
| 301 | [ |
| 302 | 'label' => __('Auto Pause', 'embedpress'), |
| 303 | 'description' => __('Set it to "Yes" to display related videos from all channels. Otherwise, related videos will show from the same channel.', 'embedpress'), |
| 304 | 'type' => Controls_Manager::SWITCHER, |
| 305 | 'label_block' => false, |
| 306 | 'return_value' => 'yes', |
| 307 | 'default' => 'yes', |
| 308 | 'condition' => [ |
| 309 | 'embedpress_pro_embeded_source' => ['selfhosted_video', 'selfhosted_audio'] |
| 310 | ], |
| 311 | ] |
| 312 | ); |
| 313 | |
| 314 | $this->add_control( |
| 315 | 'spotify_theme', |
| 316 | [ |
| 317 | 'label' => __('Player Background', 'embedpress'), |
| 318 | 'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'), |
| 319 | 'type' => Controls_Manager::SELECT, |
| 320 | 'label_block' => false, |
| 321 | 'default' => '1', |
| 322 | 'options' => [ |
| 323 | '1' => __('Dynamic', 'embedpress'), |
| 324 | '0' => __('Black & White', 'embedpress') |
| 325 | ], |
| 326 | 'condition' => [ |
| 327 | 'embedpress_pro_embeded_source' => 'spotify' |
| 328 | ] |
| 329 | ] |
| 330 | ); |
| 331 | do_action('embedpress/control/extend', $this); |
| 332 | |
| 333 | $this->add_control( |
| 334 | 'emberpress_custom_player', |
| 335 | [ |
| 336 | 'label' => __('Enable Custom Player', 'embedpress'), |
| 337 | 'type' => Controls_Manager::SWITCHER, |
| 338 | 'label_block' => false, |
| 339 | 'return_value' => 'yes', |
| 340 | 'default' => '', |
| 341 | 'condition' => [ |
| 342 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video', 'selfhosted_audio'] |
| 343 | ], |
| 344 | ] |
| 345 | ); |
| 346 | |
| 347 | $this->add_control( |
| 348 | 'custom_player_important_note', |
| 349 | [ |
| 350 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 351 | 'raw' => esc_html__('Custom player take effect only when a single video is embedded.', 'embedpress'), |
| 352 | 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info', |
| 353 | 'condition' => [ |
| 354 | 'emberpress_custom_player' => 'yes', |
| 355 | 'embedpress_pro_embeded_source' => 'youtube', |
| 356 | ], |
| 357 | ] |
| 358 | ); |
| 359 | |
| 360 | $this->add_control( |
| 361 | 'custom_payer_preset', |
| 362 | [ |
| 363 | 'label' => sprintf(__('Preset %s', 'embedpress'), $this->pro_text), |
| 364 | |
| 365 | 'type' => Controls_Manager::SELECT, |
| 366 | 'label_block' => false, |
| 367 | 'default' => 'default', |
| 368 | 'options' => [ |
| 369 | 'default' => __('Default', 'embedpress'), |
| 370 | 'custom-player-preset-1' => __('Preset 1', 'embedpress'), |
| 371 | // 'custom-player-preset-2' => __('Preset 2', 'embedpress'), |
| 372 | 'custom-player-preset-3' => __('Preset 2', 'embedpress'), |
| 373 | // 'custom-player-preset-4' => __('Preset 4', 'embedpress'), |
| 374 | ], |
| 375 | 'classes' => $this->pro_class, |
| 376 | 'condition' => [ |
| 377 | 'emberpress_custom_player' => 'yes', |
| 378 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video'] |
| 379 | ], |
| 380 | ] |
| 381 | ); |
| 382 | |
| 383 | $this->add_control( |
| 384 | 'embedpress_pro_video_start_time', |
| 385 | [ |
| 386 | 'label' => __('Start Time', 'embedpress'), |
| 387 | 'type' => Controls_Manager::NUMBER, |
| 388 | 'description' => __('Specify a start time (in seconds)', 'embedpress'), |
| 389 | 'condition' => [ |
| 390 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'wistia', 'dailymotion', 'twitch'] |
| 391 | ], |
| 392 | ] |
| 393 | ); |
| 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | /** |
| 399 | * Initialized controls |
| 400 | */ |
| 401 | $this->init_youtube_controls(); |
| 402 | $this->init_vimeo_controls(); |
| 403 | |
| 404 | $this->init_wistia_controls(); |
| 405 | $this->init_soundcloud_controls(); |
| 406 | $this->init_dailymotion_control(); |
| 407 | $this->init_twitch_control(); |
| 408 | $this->init_opensea_control(); |
| 409 | $this->end_controls_section(); |
| 410 | |
| 411 | |
| 412 | $this->init_youtube_channel_section(); |
| 413 | $this->init_youtube_subscription_section(); |
| 414 | $this->init_youtube_livechat_section(); |
| 415 | |
| 416 | |
| 417 | /** |
| 418 | * Opensea Control section |
| 419 | */ |
| 420 | $this->init_opensea_control_section(); |
| 421 | $this->init_instafeed_control_section(); |
| 422 | |
| 423 | /** |
| 424 | * Calendly Control section |
| 425 | */ |
| 426 | $this->init_calendly_control_section(); |
| 427 | |
| 428 | /** |
| 429 | * Spreaker Control section |
| 430 | */ |
| 431 | $this->init_spreaker_control_section(); |
| 432 | |
| 433 | |
| 434 | |
| 435 | do_action('extend_elementor_controls', $this, '_', $this->pro_text, $this->pro_class); |
| 436 | |
| 437 | if (!apply_filters('embedpress/is_allow_rander', false)) { |
| 438 | $this->start_controls_section( |
| 439 | 'embedpress_pro_section', |
| 440 | [ |
| 441 | 'label' => __('Go Premium for More Features', 'embedpress'), |
| 442 | ] |
| 443 | ); |
| 444 | |
| 445 | $this->add_control( |
| 446 | 'embedpress_pro_cta', |
| 447 | [ |
| 448 | 'label' => __('Unlock more possibilities', 'embedpress'), |
| 449 | 'type' => Controls_Manager::CHOOSE, |
| 450 | 'options' => [ |
| 451 | '1' => [ |
| 452 | 'title' => '', |
| 453 | 'icon' => 'eicon-lock', |
| 454 | ], |
| 455 | ], |
| 456 | 'default' => '1', |
| 457 | 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Pro version</a> for more provider support and customization options.</span>', |
| 458 | ] |
| 459 | ); |
| 460 | |
| 461 | $this->end_controls_section(); |
| 462 | } |
| 463 | |
| 464 | $this->init_style_controls(); |
| 465 | $this->init_opensea_color_and_typography(); |
| 466 | } |
| 467 | |
| 468 | /** |
| 469 | * Youtube Controls |
| 470 | */ |
| 471 | |
| 472 | public function init_youtube_controls() |
| 473 | { |
| 474 | $yt_condition = [ |
| 475 | 'embedpress_pro_embeded_source' => 'youtube' |
| 476 | ]; |
| 477 | $this->add_control( |
| 478 | 'embedpress_pro_youtube_end_time', |
| 479 | [ |
| 480 | 'label' => __('End Time', 'embedpress'), |
| 481 | 'type' => Controls_Manager::NUMBER, |
| 482 | 'description' => __('Specify an end time (in seconds)', 'embedpress'), |
| 483 | 'condition' => $yt_condition, |
| 484 | ] |
| 485 | ); |
| 486 | |
| 487 | |
| 488 | $this->add_control( |
| 489 | 'embedpress_player_color', |
| 490 | [ |
| 491 | 'label' => sprintf(__('Player Color %s', 'embedpress'), $this->pro_text), |
| 492 | 'type' => Controls_Manager::COLOR, |
| 493 | 'label_block' => false, |
| 494 | 'classes' => $this->pro_class, |
| 495 | 'default' => '#5b4e96', |
| 496 | 'condition' => [ |
| 497 | 'emberpress_custom_player' => 'yes', |
| 498 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video', 'selfhosted_audio'] |
| 499 | ], |
| 500 | ] |
| 501 | ); |
| 502 | |
| 503 | $this->add_control( |
| 504 | 'embedpress_pro_vimeo_auto_play', |
| 505 | [ |
| 506 | 'label' => __('Auto Play', 'embedpress'), |
| 507 | 'type' => Controls_Manager::SWITCHER, |
| 508 | 'label_block' => false, |
| 509 | 'return_value' => 'yes', |
| 510 | 'default' => 'no', |
| 511 | 'condition' => [ |
| 512 | 'embedpress_pro_embeded_source' => 'vimeo' |
| 513 | ] |
| 514 | ] |
| 515 | ); |
| 516 | |
| 517 | $this->add_control( |
| 518 | 'embedpress_pro_vimeo_autopause', |
| 519 | [ |
| 520 | 'label' => sprintf(__('Auto Pause %s', 'embedpress'), $this->pro_text), |
| 521 | 'type' => Controls_Manager::SWITCHER, |
| 522 | 'label_block' => false, |
| 523 | 'return_value' => 'yes', |
| 524 | 'default' => 'no', |
| 525 | 'description' => __( |
| 526 | 'Automatically stop the current video from playing when another one starts.', |
| 527 | 'embedpress' |
| 528 | ), |
| 529 | 'condition' => [ |
| 530 | 'embedpress_pro_embeded_source' => 'vimeo' |
| 531 | ], |
| 532 | 'classes' => $this->pro_class, |
| 533 | ] |
| 534 | ); |
| 535 | |
| 536 | $this->add_control( |
| 537 | 'embedpress_pro_vimeo_dnt', |
| 538 | [ |
| 539 | 'label' => sprintf(__('DNT %s', 'embedpress'), $this->pro_text), |
| 540 | 'type' => Controls_Manager::SWITCHER, |
| 541 | 'label_block' => false, |
| 542 | 'return_value' => 'yes', |
| 543 | 'default' => 'yes', |
| 544 | 'description' => __( |
| 545 | 'Set this parameter to "yes" will block tracking any session data, including cookies. If Auto Pause is enabled this will not work.', |
| 546 | 'embedpress' |
| 547 | ), |
| 548 | 'condition' => [ |
| 549 | 'embedpress_pro_embeded_source' => 'vimeo' |
| 550 | ], |
| 551 | 'classes' => $this->pro_class, |
| 552 | ] |
| 553 | ); |
| 554 | |
| 555 | |
| 556 | $this->add_control( |
| 557 | 'embedpress_pro_youtube_auto_play', |
| 558 | [ |
| 559 | 'label' => __('Auto Play', 'embedpress'), |
| 560 | 'type' => Controls_Manager::SWITCHER, |
| 561 | 'label_block' => false, |
| 562 | 'return_value' => 'yes', |
| 563 | 'default' => 'no', |
| 564 | 'condition' => $yt_condition, |
| 565 | ] |
| 566 | ); |
| 567 | $this->add_control( |
| 568 | 'embedpress_pro_youtube_player_options', |
| 569 | [ |
| 570 | 'label' => __('Player Options', 'embedpress'), |
| 571 | 'type' => Controls_Manager::HEADING, |
| 572 | 'condition' => [ |
| 573 | 'embedpress_pro_embeded_source' => 'youtube', |
| 574 | 'emberpress_custom_player!' => 'yes' |
| 575 | ], |
| 576 | ] |
| 577 | ); |
| 578 | $this->add_control( |
| 579 | 'embedpress_pro_youtube_display_controls', |
| 580 | [ |
| 581 | 'label' => __('Controls', 'embedpress'), |
| 582 | 'type' => Controls_Manager::SELECT, |
| 583 | 'label_block' => false, |
| 584 | 'default' => 1, |
| 585 | 'options' => [ |
| 586 | '1' => __('Display immediately', 'embedpress'), |
| 587 | '2' => __('Display after user initiation', 'embedpress'), |
| 588 | '0' => __('Hide controls', 'embedpress') |
| 589 | ], |
| 590 | 'condition' => [ |
| 591 | 'embedpress_pro_embeded_source' => 'youtube', |
| 592 | 'emberpress_custom_player!' => 'yes' |
| 593 | ], |
| 594 | ] |
| 595 | ); |
| 596 | $this->add_control( |
| 597 | 'embedpress_pro_youtube_enable_fullscreen_button', |
| 598 | [ |
| 599 | 'label' => __('Fullscreen button', 'embedpress'), |
| 600 | 'type' => Controls_Manager::SWITCHER, |
| 601 | 'label_block' => false, |
| 602 | 'return_value' => 'yes', |
| 603 | 'default' => 'yes', |
| 604 | 'condition' => [ |
| 605 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo'], |
| 606 | 'embedpress_pro_youtube_display_controls!' => '0' |
| 607 | ] |
| 608 | ] |
| 609 | ); |
| 610 | $this->add_control( |
| 611 | 'embedpress_pro_youtube_display_video_annotations', |
| 612 | [ |
| 613 | 'label' => __('Video Annotations', 'embedpress'), |
| 614 | 'type' => Controls_Manager::SWITCHER, |
| 615 | 'label_block' => false, |
| 616 | 'default' => 1, |
| 617 | 'options' => [ |
| 618 | '1' => __('Display', 'embedpress'), |
| 619 | '3' => __('Do Not Display', 'embedpress') |
| 620 | ], |
| 621 | 'condition' => [ |
| 622 | 'embedpress_pro_embeded_source' => 'youtube', |
| 623 | 'emberpress_custom_player!' => 'yes' |
| 624 | ], |
| 625 | ] |
| 626 | ); |
| 627 | //--- YouTube Pro control starts --- |
| 628 | $this->add_control( |
| 629 | 'embedpress_pro_youtube_progress_bar_color', |
| 630 | [ |
| 631 | 'label' => __('Progress Bar Color', 'embedpress'), |
| 632 | 'type' => Controls_Manager::SELECT, |
| 633 | 'label_block' => false, |
| 634 | 'default' => 'red', |
| 635 | 'options' => [ |
| 636 | 'red' => __('Red', 'embedpress'), |
| 637 | 'white' => __('White', 'embedpress') |
| 638 | ], |
| 639 | 'condition' => [ |
| 640 | 'embedpress_pro_embeded_source' => 'youtube', |
| 641 | 'emberpress_custom_player!' => 'yes' |
| 642 | ], |
| 643 | ] |
| 644 | ); |
| 645 | $this->add_control( |
| 646 | 'embedpress_pro_youtube_force_closed_captions', |
| 647 | [ |
| 648 | 'label' => sprintf(__('Closed Captions %s', 'embedpress'), $this->pro_text), |
| 649 | 'type' => Controls_Manager::SWITCHER, |
| 650 | 'label_block' => false, |
| 651 | 'return_value' => 'yes', |
| 652 | 'default' => 'no', |
| 653 | 'separator' => 'before', |
| 654 | 'classes' => $this->pro_class, |
| 655 | 'condition' => [ |
| 656 | 'embedpress_pro_embeded_source' => 'youtube', |
| 657 | 'emberpress_custom_player!' => 'yes' |
| 658 | ], |
| 659 | ] |
| 660 | ); |
| 661 | $this->add_control( |
| 662 | 'embedpress_pro_youtube_modest_branding', |
| 663 | [ |
| 664 | 'label' => sprintf(__('Modest Branding %s', 'embedpress'), $this->pro_text), |
| 665 | 'type' => Controls_Manager::SELECT, |
| 666 | 'label_block' => false, |
| 667 | 'default' => 1, |
| 668 | 'options' => [ |
| 669 | '0' => __('Display', 'embedpress'), |
| 670 | '1' => __('Do Not Display', 'embedpress') |
| 671 | ], |
| 672 | 'condition' => [ |
| 673 | 'embedpress_pro_embeded_source' => 'youtube', |
| 674 | 'embedpress_pro_youtube_display_controls!' => '0', |
| 675 | 'embedpress_pro_youtube_progress_bar_color!' => 'white', |
| 676 | 'embedpress_custom_player!' => 'yes', |
| 677 | ], |
| 678 | 'classes' => $this->pro_class, |
| 679 | ] |
| 680 | ); |
| 681 | |
| 682 | |
| 683 | |
| 684 | |
| 685 | |
| 686 | do_action('extend_customplayer_controls', $this, '_', $this->pro_text, $this->pro_class); |
| 687 | |
| 688 | |
| 689 | $this->add_control( |
| 690 | 'embepress_player_always_on_top', |
| 691 | [ |
| 692 | 'label' => sprintf(__('Sticky Video %s', 'embedpress'), $this->pro_text), |
| 693 | 'description' => __('Watch video and seamlessly scroll through other content with a sleek pop-up window.', 'embedpress'), |
| 694 | 'type' => Controls_Manager::SWITCHER, |
| 695 | 'label_block' => false, |
| 696 | 'return_value' => 'yes', |
| 697 | 'classes' => $this->pro_class, |
| 698 | 'default' => '', |
| 699 | 'condition' => [ |
| 700 | 'emberpress_custom_player' => 'yes', |
| 701 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video'] |
| 702 | ], |
| 703 | ] |
| 704 | ); |
| 705 | |
| 706 | $this->add_control( |
| 707 | 'embedpress_pro_youtube_display_related_videos', |
| 708 | [ |
| 709 | 'label' => __('Related Videos', 'embedpress'), |
| 710 | 'description' => __('Set it to "Yes" to display related videos from all channels. Otherwise, related videos will show from the same channel.', 'embedpress'), |
| 711 | 'type' => Controls_Manager::SWITCHER, |
| 712 | 'label_block' => false, |
| 713 | 'return_value' => 'yes', |
| 714 | 'default' => 'yes', |
| 715 | 'condition' => $yt_condition, |
| 716 | ] |
| 717 | ); |
| 718 | |
| 719 | |
| 720 | |
| 721 | $this->add_control( |
| 722 | "embedpress_player_poster_thumbnail", |
| 723 | [ |
| 724 | 'label' => sprintf(__('Thumbnail %s', 'embedpress'), $this->pro_text), |
| 725 | 'type' => Controls_Manager::MEDIA, |
| 726 | 'dynamic' => [ |
| 727 | 'active' => true, |
| 728 | ], |
| 729 | 'classes' => $this->pro_class, |
| 730 | 'condition' => [ |
| 731 | 'emberpress_custom_player' => 'yes', |
| 732 | 'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'selfhosted_video'] |
| 733 | ], |
| 734 | ] |
| 735 | ); |
| 736 | |
| 737 | $this->init_branding_controls('youtube'); |
| 738 | } |
| 739 | |
| 740 | public function init_youtube_channel_section() |
| 741 | { |
| 742 | $yt_condition = [ |
| 743 | 'embedpress_pro_embeded_source' => 'youtube', |
| 744 | ]; |
| 745 | $this->start_controls_section( |
| 746 | 'embedpress_yt_channel_section', |
| 747 | [ |
| 748 | 'label' => __('YouTube Channel', 'embedpress'), |
| 749 | 'condition' => [ |
| 750 | 'embedpress_pro_embeded_source' => 'youtube', |
| 751 | 'emberpress_custom_player!' => 'yes' |
| 752 | ], |
| 753 | |
| 754 | ] |
| 755 | ); |
| 756 | |
| 757 | $this->add_control( |
| 758 | 'important_note', |
| 759 | [ |
| 760 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 761 | 'raw' => esc_html__('These options take effect only when a YouTube channel is embedded.', 'embedpress'), |
| 762 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 763 | ] |
| 764 | ); |
| 765 | |
| 766 | $this->add_control( |
| 767 | 'ytChannelLayout', |
| 768 | [ |
| 769 | 'label' => __('Layout', 'embedpress'), |
| 770 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 771 | 'label_block' => false, |
| 772 | 'default' => 'gallery', |
| 773 | 'options' => [ |
| 774 | 'gallery' => esc_html__('Gallery', 'embedpress'), |
| 775 | 'list' => esc_html__('List', 'embedpress'), |
| 776 | 'grid' => sprintf(esc_html__('Grid %s', 'embedpress'), $this->pro_label), |
| 777 | 'carousel' => sprintf(esc_html__('Carousel %s', 'embedpress'), $this->pro_label), |
| 778 | ], |
| 779 | 'conditions' => [ |
| 780 | 'terms' => [ |
| 781 | [ |
| 782 | 'name' => 'embedpress_pro_embeded_source', |
| 783 | 'operator' => '===', |
| 784 | 'value' => 'youtube', |
| 785 | ], |
| 786 | ], |
| 787 | ] |
| 788 | ] |
| 789 | ); |
| 790 | |
| 791 | |
| 792 | $this->add_control( |
| 793 | 'pagesize', |
| 794 | [ |
| 795 | 'label' => __('Video Per Page', 'embedpress'), |
| 796 | 'type' => Controls_Manager::NUMBER, |
| 797 | 'label_block' => false, |
| 798 | 'default' => 6, |
| 799 | 'min' => 1, |
| 800 | 'max' => 50, |
| 801 | 'conditions' => [ |
| 802 | 'terms' => [ |
| 803 | [ |
| 804 | 'name' => 'embedpress_pro_embeded_source', |
| 805 | 'operator' => '===', |
| 806 | 'value' => 'youtube', |
| 807 | ], |
| 808 | ], |
| 809 | ] |
| 810 | ] |
| 811 | ); |
| 812 | |
| 813 | $this->add_control( |
| 814 | 'columns', |
| 815 | [ |
| 816 | 'label' => __('Column', 'embedpress'), |
| 817 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 818 | 'label_block' => false, |
| 819 | 'default' => '3', |
| 820 | 'options' => [ |
| 821 | '2' => esc_html__('2', 'embedpress'), |
| 822 | '3' => esc_html__('3', 'embedpress'), |
| 823 | '4' => esc_html__('4', 'embedpress'), |
| 824 | '6' => esc_html__('6', 'embedpress'), |
| 825 | 'auto' => esc_html__('Auto', 'embedpress'), |
| 826 | ], |
| 827 | 'conditions' => [ |
| 828 | 'terms' => [ |
| 829 | [ |
| 830 | 'name' => 'embedpress_pro_embeded_source', |
| 831 | 'operator' => '===', |
| 832 | 'value' => 'youtube', |
| 833 | ], |
| 834 | [ |
| 835 | 'name' => 'ytChannelLayout', |
| 836 | 'operator' => '!==', |
| 837 | 'value' => 'list', |
| 838 | ], |
| 839 | [ |
| 840 | 'name' => 'ytChannelLayout', |
| 841 | 'operator' => '!==', |
| 842 | 'value' => 'carousel', |
| 843 | ], |
| 844 | ], |
| 845 | ] |
| 846 | ] |
| 847 | ); |
| 848 | $this->add_control( |
| 849 | 'gapbetweenvideos', |
| 850 | [ |
| 851 | 'label' => __('Gap Between Videos', 'embedpress'), |
| 852 | 'label_block' => true, |
| 853 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 854 | 'size_units' => ['px', '%'], |
| 855 | 'range' => [ |
| 856 | 'px' => [ |
| 857 | 'min' => 0, |
| 858 | 'max' => 100, |
| 859 | 'step' => 1, |
| 860 | ], |
| 861 | '%' => [ |
| 862 | 'min' => 0, |
| 863 | 'max' => 100, |
| 864 | ], |
| 865 | ], |
| 866 | 'default' => [ |
| 867 | 'unit' => 'px', |
| 868 | 'size' => 30, |
| 869 | ], |
| 870 | 'conditions' => [ |
| 871 | 'terms' => [ |
| 872 | [ |
| 873 | 'name' => 'embedpress_pro_embeded_source', |
| 874 | 'operator' => '===', |
| 875 | 'value' => 'youtube', |
| 876 | ], |
| 877 | [ |
| 878 | 'name' => 'ytChannelLayout', |
| 879 | 'operator' => '!==', |
| 880 | 'value' => 'carousel', |
| 881 | ], |
| 882 | ], |
| 883 | ], |
| 884 | 'selectors' => [ |
| 885 | '{{WRAPPER}} .ep-youtube__content__block .youtube__content__body .content__wrap:not(.youtube-carousel)' => 'gap: {{SIZE}}{{UNIT}}!important;margin-top: {{SIZE}}{{UNIT}}!important;', |
| 886 | ], |
| 887 | ] |
| 888 | ); |
| 889 | |
| 890 | $this->add_control( |
| 891 | 'pagination', |
| 892 | [ |
| 893 | 'label' => __('Pagination', 'embedpress'), |
| 894 | 'type' => Controls_Manager::SWITCHER, |
| 895 | 'label_block' => false, |
| 896 | 'label_on' => esc_html__('Show', 'embedpress'), |
| 897 | 'label_off' => esc_html__('Hide', 'embedpress'), |
| 898 | 'return_value' => 'show', |
| 899 | 'default' => 'show', |
| 900 | 'condition' => [ |
| 901 | 'terms' => [ |
| 902 | [ |
| 903 | 'name' => 'embedpress_pro_embeded_source', |
| 904 | 'operator' => '===', |
| 905 | 'value' => 'youtube', |
| 906 | ], |
| 907 | [ |
| 908 | 'name' => 'ytChannelLayout', |
| 909 | 'operator' => '!==', |
| 910 | 'value' => 'carousel', |
| 911 | ], |
| 912 | ], |
| 913 | ], |
| 914 | ] |
| 915 | ); |
| 916 | |
| 917 | $this->end_controls_section(); |
| 918 | } |
| 919 | public function init_youtube_subscription_section() |
| 920 | { |
| 921 | $yt_condition = [ |
| 922 | 'embedpress_pro_embeded_source' => 'youtube', |
| 923 | ]; |
| 924 | $this->start_controls_section( |
| 925 | 'embedpress_yt_subscription_section', |
| 926 | [ |
| 927 | 'label' => __('YouTube Subscriber', 'embedpress'), |
| 928 | 'condition' => $yt_condition, |
| 929 | |
| 930 | ] |
| 931 | ); |
| 932 | |
| 933 | |
| 934 | $this->add_control( |
| 935 | 'yt_sub_channel', |
| 936 | [ |
| 937 | |
| 938 | 'label' => sprintf(__('Channel ID %s', 'embedpress'), $this->pro_text), |
| 939 | 'type' => Controls_Manager::TEXT, |
| 940 | 'dynamic' => [ |
| 941 | 'active' => true, |
| 942 | ], |
| 943 | 'placeholder' => __('Enter Channel ID', 'embedpress'), |
| 944 | 'label_block' => true, |
| 945 | 'condition' => $yt_condition, |
| 946 | 'classes' => $this->pro_class, |
| 947 | ] |
| 948 | ); |
| 949 | $this->add_control( |
| 950 | 'yt_sub_text', |
| 951 | [ |
| 952 | |
| 953 | 'label' => sprintf(__('Subscription Text %s', 'embedpress'), $this->pro_text), |
| 954 | 'type' => Controls_Manager::TEXT, |
| 955 | 'dynamic' => [ |
| 956 | 'active' => true, |
| 957 | ], |
| 958 | 'placeholder' => __('Eg. Don\'t miss out! Subscribe', 'embedpress'), |
| 959 | 'label_block' => true, |
| 960 | 'condition' => $yt_condition, |
| 961 | 'classes' => $this->pro_class, |
| 962 | ] |
| 963 | ); |
| 964 | |
| 965 | |
| 966 | $this->add_control( |
| 967 | 'yt_sub_layout', |
| 968 | [ |
| 969 | 'label' => sprintf(__('Layout %s', 'embedpress'), $this->pro_text), |
| 970 | 'type' => Controls_Manager::SELECT, |
| 971 | 'label_block' => false, |
| 972 | 'default' => 'default', |
| 973 | 'options' => [ |
| 974 | 'default' => __('Default', 'embedpress'), |
| 975 | 'full' => __('Full', 'embedpress') |
| 976 | ], |
| 977 | 'condition' => [ |
| 978 | 'embedpress_pro_embeded_source' => 'youtube', |
| 979 | ], |
| 980 | 'classes' => $this->pro_class, |
| 981 | ] |
| 982 | ); |
| 983 | |
| 984 | $this->add_control( |
| 985 | 'yt_sub_theme', |
| 986 | [ |
| 987 | 'label' => sprintf(__('Theme %s', 'embedpress'), $this->pro_text), |
| 988 | 'type' => Controls_Manager::SELECT, |
| 989 | 'label_block' => false, |
| 990 | 'default' => 'default', |
| 991 | 'options' => [ |
| 992 | 'default' => __('Default', 'embedpress'), |
| 993 | 'dark' => __('Dark', 'embedpress') |
| 994 | ], |
| 995 | 'condition' => [ |
| 996 | 'embedpress_pro_embeded_source' => 'youtube', |
| 997 | ], |
| 998 | 'classes' => $this->pro_class, |
| 999 | ] |
| 1000 | ); |
| 1001 | |
| 1002 | $this->add_control( |
| 1003 | 'yt_sub_count', |
| 1004 | [ |
| 1005 | 'label' => sprintf(__('Subscriber Count %s', 'embedpress'), $this->pro_text), |
| 1006 | 'type' => Controls_Manager::SWITCHER, |
| 1007 | 'label_block' => false, |
| 1008 | 'return_value' => 'yes', |
| 1009 | 'default' => 'yes', |
| 1010 | 'condition' => $yt_condition, |
| 1011 | 'classes' => $this->pro_class, |
| 1012 | ] |
| 1013 | ); |
| 1014 | |
| 1015 | $this->end_controls_section(); |
| 1016 | } |
| 1017 | |
| 1018 | public function init_youtube_livechat_section() |
| 1019 | { |
| 1020 | $yt_condition = [ |
| 1021 | 'embedpress_pro_embeded_source' => 'youtube', |
| 1022 | ]; |
| 1023 | $this->start_controls_section( |
| 1024 | 'embedpress_yt_livechat_section', |
| 1025 | [ |
| 1026 | 'label' => __('YouTube Live Chat', 'embedpress'), |
| 1027 | 'condition' => $yt_condition, |
| 1028 | |
| 1029 | ] |
| 1030 | ); |
| 1031 | |
| 1032 | $this->add_control( |
| 1033 | 'yt_lc_show', |
| 1034 | [ |
| 1035 | 'label' => sprintf(__('Show YouTube Live Chat %s', 'embedpress'), $this->pro_text), |
| 1036 | 'type' => Controls_Manager::SWITCHER, |
| 1037 | 'label_block' => false, |
| 1038 | 'return_value' => 'yes', |
| 1039 | 'default' => '', |
| 1040 | 'label_off' => __('Hide', 'embedpress'), |
| 1041 | 'label_on' => __('Show', 'embedpress'), |
| 1042 | 'condition' => $yt_condition, |
| 1043 | 'classes' => $this->pro_class, |
| 1044 | ] |
| 1045 | ); |
| 1046 | |
| 1047 | |
| 1048 | $this->end_controls_section(); |
| 1049 | } |
| 1050 | |
| 1051 | //End Youtube Controls |
| 1052 | |
| 1053 | /** |
| 1054 | * Dailymotion Controls |
| 1055 | */ |
| 1056 | public function init_dailymotion_control() |
| 1057 | { |
| 1058 | //@TODO; Kamal - migrate from 'embedpress_pro_dailymotion_logo' to 'embedpress_pro_dailymotion_ui_logo' |
| 1059 | $this->add_control( |
| 1060 | 'embedpress_pro_dailymotion_ui_logo', |
| 1061 | [ |
| 1062 | 'label' => sprintf(__('Logo %s', 'embedpress'), $this->pro_text), |
| 1063 | 'type' => Controls_Manager::SWITCHER, |
| 1064 | 'label_block' => false, |
| 1065 | 'return_value' => 'yes', |
| 1066 | 'default' => 'yes', |
| 1067 | 'label_off' => __('Hide', 'embedpress'), |
| 1068 | 'label_on' => __('Show', 'embedpress'), |
| 1069 | 'condition' => [ |
| 1070 | 'embedpress_pro_embeded_source' => 'dailymotion' |
| 1071 | ], |
| 1072 | 'classes' => $this->pro_class, |
| 1073 | ] |
| 1074 | ); |
| 1075 | $this->add_control( |
| 1076 | 'embedpress_pro_dailymotion_autoplay', |
| 1077 | [ |
| 1078 | 'label' => __('Auto Play', 'embedpress'), |
| 1079 | 'type' => Controls_Manager::SWITCHER, |
| 1080 | 'label_block' => false, |
| 1081 | 'return_value' => 'yes', |
| 1082 | 'default' => 'no', |
| 1083 | 'label_off' => __('Hide', 'embedpress'), |
| 1084 | 'label_on' => __('Show', 'embedpress'), |
| 1085 | 'condition' => [ |
| 1086 | 'embedpress_pro_embeded_source' => 'dailymotion' |
| 1087 | ] |
| 1088 | ] |
| 1089 | ); |
| 1090 | $this->add_control( |
| 1091 | 'embedpress_pro_dailymotion_play_on_mobile', |
| 1092 | [ |
| 1093 | 'label' => __('Play On Mobile', 'embedpress'), |
| 1094 | 'type' => Controls_Manager::SWITCHER, |
| 1095 | 'label_block' => false, |
| 1096 | 'return_value' => 'yes', |
| 1097 | 'default' => 'no', |
| 1098 | 'label_off' => __('Hide', 'embedpress'), |
| 1099 | 'label_on' => __('Show', 'embedpress'), |
| 1100 | 'condition' => [ |
| 1101 | 'embedpress_pro_embeded_source' => 'dailymotion', |
| 1102 | 'embedpress_pro_dailymotion_autoplay' => 'yes' |
| 1103 | ] |
| 1104 | ] |
| 1105 | ); |
| 1106 | $this->add_control( |
| 1107 | 'embedpress_pro_dailymotion_mute', |
| 1108 | [ |
| 1109 | 'label' => __('Mute', 'embedpress'), |
| 1110 | 'type' => Controls_Manager::SWITCHER, |
| 1111 | 'label_block' => false, |
| 1112 | 'return_value' => 'yes', |
| 1113 | 'default' => 'no', |
| 1114 | 'label_off' => __('Hide', 'embedpress'), |
| 1115 | 'label_on' => __('Show', 'embedpress'), |
| 1116 | 'condition' => [ |
| 1117 | 'embedpress_pro_embeded_source' => 'dailymotion' |
| 1118 | ] |
| 1119 | ] |
| 1120 | ); |
| 1121 | $this->add_control( |
| 1122 | 'embedpress_pro_dailymotion_player_control', |
| 1123 | [ |
| 1124 | 'label' => __('Player Controls', 'embedpress'), |
| 1125 | 'type' => Controls_Manager::SWITCHER, |
| 1126 | 'label_block' => false, |
| 1127 | 'return_value' => 'yes', |
| 1128 | 'default' => 'yes', |
| 1129 | 'label_off' => __('Hide', 'embedpress'), |
| 1130 | 'label_on' => __('Show', 'embedpress'), |
| 1131 | 'condition' => [ |
| 1132 | 'embedpress_pro_embeded_source' => 'dailymotion' |
| 1133 | ] |
| 1134 | ] |
| 1135 | ); |
| 1136 | $this->add_control( |
| 1137 | 'embedpress_pro_dailymotion_video_info', |
| 1138 | [ |
| 1139 | 'label' => __('Video Info', 'embedpress'), |
| 1140 | 'type' => Controls_Manager::SWITCHER, |
| 1141 | 'label_block' => false, |
| 1142 | 'return_value' => 'yes', |
| 1143 | 'default' => 'yes', |
| 1144 | 'label_off' => __('Hide', 'embedpress'), |
| 1145 | 'label_on' => __('Show', 'embedpress'), |
| 1146 | 'condition' => [ |
| 1147 | 'embedpress_pro_embeded_source' => 'dailymotion' |
| 1148 | ] |
| 1149 | ] |
| 1150 | ); |
| 1151 | $this->add_control( |
| 1152 | 'embedpress_pro_dailymotion_control_color', |
| 1153 | [ |
| 1154 | 'label' => __('Control Color', 'embedpress'), |
| 1155 | 'type' => Controls_Manager::COLOR, |
| 1156 | 'label_block' => false, |
| 1157 | 'default' => '#dd3333', |
| 1158 | 'condition' => [ |
| 1159 | 'embedpress_pro_embeded_source' => 'dailymotion' |
| 1160 | ] |
| 1161 | ] |
| 1162 | ); |
| 1163 | $this->init_branding_controls('dailymotion'); |
| 1164 | } |
| 1165 | //End Dailymotion Controls |
| 1166 | |
| 1167 | /** |
| 1168 | * Wistia Controls |
| 1169 | */ |
| 1170 | public function init_wistia_controls() |
| 1171 | { |
| 1172 | $this->add_control( |
| 1173 | 'embedpress_pro_wistia_auto_play', |
| 1174 | [ |
| 1175 | 'label' => __('Auto Play', 'embedpress'), |
| 1176 | 'type' => Controls_Manager::SWITCHER, |
| 1177 | 'label_block' => false, |
| 1178 | 'return_value' => 'yes', |
| 1179 | 'default' => 'no', |
| 1180 | 'condition' => [ |
| 1181 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1182 | ], |
| 1183 | ] |
| 1184 | ); |
| 1185 | |
| 1186 | $this->add_control( |
| 1187 | 'embedpress_pro_wistia_color', |
| 1188 | [ |
| 1189 | 'label' => __('Scheme', 'embedpress'), |
| 1190 | 'type' => Controls_Manager::COLOR, |
| 1191 | 'label_block' => false, |
| 1192 | 'default' => '#dd3333', |
| 1193 | 'condition' => [ |
| 1194 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1195 | ] |
| 1196 | ] |
| 1197 | ); |
| 1198 | |
| 1199 | |
| 1200 | |
| 1201 | $this->add_control( |
| 1202 | 'embedpress_pro_wistia_captions_enabled_by_default', |
| 1203 | [ |
| 1204 | 'label' => __('Captions Enabled By Default', 'embedpress'), |
| 1205 | 'type' => Controls_Manager::SWITCHER, |
| 1206 | 'label_block' => false, |
| 1207 | 'return_value' => 'yes', |
| 1208 | 'default' => 'no', |
| 1209 | 'condition' => [ |
| 1210 | 'embedpress_pro_embeded_source' => 'wistia', |
| 1211 | 'embedpress_pro_wistia_captions' => 'yes' |
| 1212 | ], |
| 1213 | 'classes' => $this->pro_class, |
| 1214 | ] |
| 1215 | ); |
| 1216 | |
| 1217 | $this->add_control( |
| 1218 | 'embedpress_pro_wistia_player_options', |
| 1219 | [ |
| 1220 | 'label' => __('Player Options', 'embedpress'), |
| 1221 | 'type' => Controls_Manager::HEADING, |
| 1222 | 'separator' => 'before', |
| 1223 | 'condition' => [ |
| 1224 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1225 | ] |
| 1226 | ] |
| 1227 | ); |
| 1228 | |
| 1229 | |
| 1230 | |
| 1231 | $this->add_control( |
| 1232 | 'embedpress_pro_wistia_fullscreen_button', |
| 1233 | [ |
| 1234 | 'label' => __('Fullscreen Button', 'embedpress'), |
| 1235 | 'type' => Controls_Manager::SWITCHER, |
| 1236 | 'label_block' => false, |
| 1237 | 'return_value' => 'yes', |
| 1238 | 'default' => 'no', |
| 1239 | 'condition' => [ |
| 1240 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1241 | ], |
| 1242 | ] |
| 1243 | ); |
| 1244 | |
| 1245 | $this->add_control( |
| 1246 | 'embedpress_pro_wistia_small_play_button', |
| 1247 | [ |
| 1248 | 'label' => __('Small Play Button', 'embedpress'), |
| 1249 | 'type' => Controls_Manager::SWITCHER, |
| 1250 | 'label_block' => false, |
| 1251 | 'return_value' => 'yes', |
| 1252 | 'default' => 'no', |
| 1253 | 'condition' => [ |
| 1254 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1255 | ], |
| 1256 | ] |
| 1257 | ); |
| 1258 | |
| 1259 | |
| 1260 | |
| 1261 | |
| 1262 | $this->add_control( |
| 1263 | 'embedpress_pro_wistia_resumable', |
| 1264 | [ |
| 1265 | 'label' => __('Resumable', 'embedpress'), |
| 1266 | 'type' => Controls_Manager::SWITCHER, |
| 1267 | 'label_block' => false, |
| 1268 | 'return_value' => 'yes', |
| 1269 | 'default' => 'no', |
| 1270 | 'condition' => [ |
| 1271 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1272 | ], |
| 1273 | ] |
| 1274 | ); |
| 1275 | |
| 1276 | |
| 1277 | $this->add_control( |
| 1278 | 'embedpress_pro_wistia_focus', |
| 1279 | [ |
| 1280 | 'label' => __('Focus', 'embedpress'), |
| 1281 | 'type' => Controls_Manager::SWITCHER, |
| 1282 | 'label_block' => false, |
| 1283 | 'return_value' => 'yes', |
| 1284 | 'default' => 'no', |
| 1285 | 'condition' => [ |
| 1286 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1287 | ], |
| 1288 | ] |
| 1289 | ); |
| 1290 | |
| 1291 | // --- Wistia PRO Controls -- |
| 1292 | $this->add_control( |
| 1293 | 'embedpress_pro_wistia_captions', |
| 1294 | [ |
| 1295 | 'label' => sprintf(__('Closed Captions %s', 'embedpress'), $this->pro_text), |
| 1296 | 'type' => Controls_Manager::SWITCHER, |
| 1297 | 'label_block' => false, |
| 1298 | 'return_value' => 'yes', |
| 1299 | 'default' => 'no', |
| 1300 | 'condition' => [ |
| 1301 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1302 | ], |
| 1303 | 'classes' => $this->pro_class, |
| 1304 | ] |
| 1305 | ); |
| 1306 | $this->add_control( |
| 1307 | 'embedpress_pro_wistia_playbar', |
| 1308 | [ |
| 1309 | 'label' => __('Playbar ', 'embedpress'), |
| 1310 | 'type' => Controls_Manager::SWITCHER, |
| 1311 | 'label_block' => false, |
| 1312 | 'return_value' => 'yes', |
| 1313 | 'default' => 'no', |
| 1314 | 'condition' => [ |
| 1315 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1316 | ], |
| 1317 | ] |
| 1318 | ); |
| 1319 | |
| 1320 | $this->add_control( |
| 1321 | 'embedpress_pro_wistia_volume_control', |
| 1322 | [ |
| 1323 | 'label' => sprintf(__('Volume Control %s', 'embedpress'), $this->pro_text), |
| 1324 | 'type' => Controls_Manager::SWITCHER, |
| 1325 | 'label_block' => false, |
| 1326 | 'return_value' => 'yes', |
| 1327 | 'default' => 'yes', |
| 1328 | 'condition' => [ |
| 1329 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1330 | ], |
| 1331 | 'classes' => $this->pro_class, |
| 1332 | ] |
| 1333 | ); |
| 1334 | |
| 1335 | |
| 1336 | $this->add_control( |
| 1337 | 'embedpress_pro_wistia_volume', |
| 1338 | [ |
| 1339 | 'label' => sprintf(__('Volume %s', 'embedpress'), $this->pro_text), |
| 1340 | 'type' => Controls_Manager::SLIDER, |
| 1341 | 'default' => [ |
| 1342 | 'size' => 100, |
| 1343 | ], |
| 1344 | 'range' => [ |
| 1345 | 'px' => [ |
| 1346 | 'min' => 0, |
| 1347 | 'max' => 100, |
| 1348 | ] |
| 1349 | ], |
| 1350 | 'condition' => [ |
| 1351 | 'embedpress_pro_embeded_source' => 'wistia', |
| 1352 | 'embedpress_pro_wistia_volume_control' => 'yes' |
| 1353 | ], |
| 1354 | 'classes' => $this->pro_class, |
| 1355 | ] |
| 1356 | ); |
| 1357 | |
| 1358 | $this->add_control( |
| 1359 | 'embedpress_pro_wistia_rewind', |
| 1360 | [ |
| 1361 | 'label' => __('Rewind', 'embedpress'), |
| 1362 | 'type' => Controls_Manager::SWITCHER, |
| 1363 | 'label_block' => false, |
| 1364 | 'return_value' => 'yes', |
| 1365 | 'default' => 'no', |
| 1366 | 'condition' => [ |
| 1367 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1368 | ], |
| 1369 | ] |
| 1370 | ); |
| 1371 | |
| 1372 | $this->add_control( |
| 1373 | 'embedpress_pro_wistia_rewind_time', |
| 1374 | [ |
| 1375 | 'label' => __('Rewind time', 'embedpress'), |
| 1376 | 'type' => Controls_Manager::SLIDER, |
| 1377 | 'default' => [ |
| 1378 | 'size' => 10, |
| 1379 | ], |
| 1380 | 'range' => [ |
| 1381 | 'px' => [ |
| 1382 | 'min' => 1, |
| 1383 | 'max' => 100, |
| 1384 | ] |
| 1385 | ], |
| 1386 | 'condition' => [ |
| 1387 | 'embedpress_pro_wistia_rewind' => 'yes', |
| 1388 | 'embedpress_pro_embeded_source' => 'wistia' |
| 1389 | ], |
| 1390 | ] |
| 1391 | ); |
| 1392 | $this->init_branding_controls('wistia'); |
| 1393 | } |
| 1394 | //End Wistia controls |
| 1395 | |
| 1396 | |
| 1397 | |
| 1398 | /** |
| 1399 | * Twitch Controls |
| 1400 | */ |
| 1401 | public function init_twitch_control() |
| 1402 | { |
| 1403 | $condition = [ |
| 1404 | 'embedpress_pro_embeded_source' => 'twitch' |
| 1405 | ]; |
| 1406 | $this->add_control( |
| 1407 | 'embedpress_pro_twitch_autoplay', |
| 1408 | [ |
| 1409 | 'label' => __('Autoplay', 'embedpress'), |
| 1410 | 'type' => Controls_Manager::SWITCHER, |
| 1411 | 'label_off' => __('No', 'embedpress'), |
| 1412 | 'label_on' => __('Yes', 'embedpress'), |
| 1413 | 'default' => 'yes', |
| 1414 | 'condition' => $condition, |
| 1415 | ] |
| 1416 | ); |
| 1417 | $this->add_control( |
| 1418 | 'embedpress_pro_fs', |
| 1419 | [ |
| 1420 | 'label' => __('Allow Full Screen Video', 'embedpress'), |
| 1421 | 'type' => Controls_Manager::SWITCHER, |
| 1422 | 'label_off' => __('No', 'embedpress'), |
| 1423 | 'label_on' => __('Yes', 'embedpress'), |
| 1424 | 'default' => 'yes', |
| 1425 | 'condition' => $condition, |
| 1426 | ] |
| 1427 | ); |
| 1428 | |
| 1429 | // -- Twitch PRO controls -- |
| 1430 | $this->add_control( |
| 1431 | 'embedpress_pro_twitch_chat', |
| 1432 | [ |
| 1433 | 'label' => sprintf(__('Show Chat %s', 'embedpress'), $this->pro_text), |
| 1434 | 'type' => Controls_Manager::SWITCHER, |
| 1435 | 'label_off' => __('Hide', 'embedpress'), |
| 1436 | 'label_on' => __('Show', 'embedpress'), |
| 1437 | 'condition' => $condition, |
| 1438 | 'classes' => $this->pro_class, |
| 1439 | |
| 1440 | ] |
| 1441 | ); |
| 1442 | $this->add_control( |
| 1443 | 'embedpress_pro_twitch_mute', |
| 1444 | [ |
| 1445 | 'label' => __('Mute on start', 'embedpress'), |
| 1446 | 'type' => Controls_Manager::SWITCHER, |
| 1447 | 'label_off' => __('Hide', 'embedpress'), |
| 1448 | 'label_on' => __('Show', 'embedpress'), |
| 1449 | 'condition' => $condition, |
| 1450 | ] |
| 1451 | ); |
| 1452 | $this->add_control( |
| 1453 | 'embedpress_pro_twitch_theme', |
| 1454 | [ |
| 1455 | 'label' => __('Theme', 'embedpress'), |
| 1456 | 'type' => Controls_Manager::SELECT, |
| 1457 | 'default' => 'dark', |
| 1458 | 'options' => [ |
| 1459 | 'dark' => __('Dark', 'embedpress'), |
| 1460 | 'light' => __('Light', 'embedpress'), |
| 1461 | ], |
| 1462 | 'condition' => $condition, |
| 1463 | ] |
| 1464 | ); |
| 1465 | |
| 1466 | $this->init_branding_controls('twitch'); |
| 1467 | } |
| 1468 | //End Twitch controls |
| 1469 | |
| 1470 | |
| 1471 | /** |
| 1472 | * SoundCloud Controls |
| 1473 | */ |
| 1474 | public function init_soundcloud_controls() |
| 1475 | { |
| 1476 | $this->add_control( |
| 1477 | 'embedpress_pro_soundcloud_visual', |
| 1478 | [ |
| 1479 | 'label' => __('Visual Player', 'embedpress'), |
| 1480 | 'type' => Controls_Manager::SWITCHER, |
| 1481 | 'label_block' => false, |
| 1482 | 'return_value' => 'yes', |
| 1483 | 'default' => 'no', |
| 1484 | 'label_off' => __('Hide', 'embedpress'), |
| 1485 | 'label_on' => __('Show', 'embedpress'), |
| 1486 | 'condition' => [ |
| 1487 | 'embedpress_pro_embeded_source' => 'soundcloud' |
| 1488 | ], |
| 1489 | ] |
| 1490 | ); |
| 1491 | |
| 1492 | $this->add_control( |
| 1493 | 'embedpress_pro_soundcloud_color', |
| 1494 | [ |
| 1495 | 'label' => __('Scheme', 'embedpress'), |
| 1496 | 'type' => Controls_Manager::COLOR, |
| 1497 | 'label_block' => false, |
| 1498 | 'default' => '#FF5500', |
| 1499 | 'condition' => [ |
| 1500 | 'embedpress_pro_embeded_source' => 'soundcloud' |
| 1501 | ] |
| 1502 | ] |
| 1503 | ); |
| 1504 | |
| 1505 | $this->add_control( |
| 1506 | 'embedpress_pro_soundcloud_autoplay', |
| 1507 | [ |
| 1508 | 'label' => __('Auto Play', 'embedpress'), |
| 1509 | 'type' => Controls_Manager::SWITCHER, |
| 1510 | 'label_block' => false, |
| 1511 | 'return_value' => 'yes', |
| 1512 | 'default' => 'no', |
| 1513 | 'label_off' => __('Hide', 'embedpress'), |
| 1514 | 'label_on' => __('Show', 'embedpress'), |
| 1515 | 'condition' => [ |
| 1516 | 'embedpress_pro_embeded_source' => 'soundcloud' |
| 1517 | ], |
| 1518 | ] |
| 1519 | ); |
| 1520 | |
| 1521 | |
| 1522 | |
| 1523 | $this->add_control( |
| 1524 | 'embedpress_pro_soundcloud_share_button', |
| 1525 | [ |
| 1526 | 'label' => __('Share Button', 'embedpress'), |
| 1527 | 'type' => Controls_Manager::SWITCHER, |
| 1528 | 'label_block' => false, |
| 1529 | 'return_value' => 'yes', |
| 1530 | 'default' => 'yes', |
| 1531 | 'label_off' => __('Hide', 'embedpress'), |
| 1532 | 'label_on' => __('Show', 'embedpress'), |
| 1533 | 'condition' => [ |
| 1534 | 'embedpress_pro_embeded_source' => 'soundcloud' |
| 1535 | ], |
| 1536 | ] |
| 1537 | ); |
| 1538 | |
| 1539 | $this->add_control( |
| 1540 | 'embedpress_pro_soundcloud_comments', |
| 1541 | [ |
| 1542 | 'label' => __('Comments', 'embedpress'), |
| 1543 | 'type' => Controls_Manager::SWITCHER, |
| 1544 | 'label_block' => false, |
| 1545 | 'return_value' => 'yes', |
| 1546 | 'default' => 'yes', |
| 1547 | 'label_off' => __('Hide', 'embedpress'), |
| 1548 | 'label_on' => __('Show', 'embedpress'), |
| 1549 | 'condition' => [ |
| 1550 | 'embedpress_pro_embeded_source' => 'soundcloud' |
| 1551 | ], |
| 1552 | ] |
| 1553 | ); |
| 1554 | |
| 1555 | |
| 1556 | |
| 1557 | $this->add_control( |
| 1558 | 'embedpress_pro_soundcloud_artwork', |
| 1559 | [ |
| 1560 | 'label' => __('Artwork', 'embedpress'), |
| 1561 | 'type' => Controls_Manager::SWITCHER, |
| 1562 | 'label_block' => false, |
| 1563 | 'return_value' => 'yes', |
| 1564 | 'default' => 'yes', |
| 1565 | 'label_off' => __('Hide', 'embedpress'), |
| 1566 | 'label_on' => __('Show', 'embedpress'), |
| 1567 | 'condition' => [ |
| 1568 | 'embedpress_pro_embeded_source' => 'soundcloud', |
| 1569 | 'embedpress_pro_soundcloud_visual!' => 'yes' |
| 1570 | ] |
| 1571 | ] |
| 1572 | ); |
| 1573 | |
| 1574 | $this->add_control( |
| 1575 | 'embedpress_pro_soundcloud_play_count', |
| 1576 | [ |
| 1577 | 'label' => __('Play Count', 'embedpress'), |
| 1578 | 'type' => Controls_Manager::SWITCHER, |
| 1579 | 'label_block' => false, |
| 1580 | 'return_value' => 'yes', |
| 1581 | 'default' => 'yes', |
| 1582 | 'label_off' => __('Hide', 'embedpress'), |
| 1583 | 'label_on' => __('Show', 'embedpress'), |
| 1584 | 'condition' => [ |
| 1585 | 'embedpress_pro_embeded_source' => 'soundcloud', |
| 1586 | 'embedpress_pro_soundcloud_visual!' => 'yes' |
| 1587 | ], |
| 1588 | ] |
| 1589 | ); |
| 1590 | |
| 1591 | $this->add_control( |
| 1592 | 'embedpress_pro_soundcloud_user_name', |
| 1593 | [ |
| 1594 | 'label' => __('User Name', 'embedpress'), |
| 1595 | 'type' => Controls_Manager::SWITCHER, |
| 1596 | 'label_block' => false, |
| 1597 | 'return_value' => 'yes', |
| 1598 | 'default' => 'yes', |
| 1599 | 'label_off' => __('Hide', 'embedpress'), |
| 1600 | 'label_on' => __('Show', 'embedpress'), |
| 1601 | 'condition' => [ |
| 1602 | 'embedpress_pro_embeded_source' => 'soundcloud' |
| 1603 | ], |
| 1604 | ] |
| 1605 | ); |
| 1606 | |
| 1607 | $this->add_control( |
| 1608 | 'embedpress_pro_soundcloud_buy_button', |
| 1609 | [ |
| 1610 | 'label' => sprintf(__('Buy Button %s', 'embedpress'), $this->pro_text), |
| 1611 | 'type' => Controls_Manager::SWITCHER, |
| 1612 | 'label_block' => false, |
| 1613 | 'return_value' => 'yes', |
| 1614 | 'default' => 'yes', |
| 1615 | 'label_off' => __('Hide', 'embedpress'), |
| 1616 | 'label_on' => __('Show', 'embedpress'), |
| 1617 | 'condition' => [ |
| 1618 | 'embedpress_pro_embeded_source' => 'soundcloud' |
| 1619 | ], |
| 1620 | 'classes' => $this->pro_class, |
| 1621 | ] |
| 1622 | ); |
| 1623 | $this->add_control( |
| 1624 | 'embedpress_pro_soundcloud_download_button', |
| 1625 | [ |
| 1626 | 'label' => sprintf(__('Download Button %s', 'embedpress'), $this->pro_text), |
| 1627 | 'type' => Controls_Manager::SWITCHER, |
| 1628 | 'label_block' => false, |
| 1629 | 'return_value' => 'yes', |
| 1630 | 'default' => 'yes', |
| 1631 | 'label_off' => __('Hide', 'embedpress'), |
| 1632 | 'label_on' => __('Show', 'embedpress'), |
| 1633 | 'condition' => [ |
| 1634 | 'embedpress_pro_embeded_source' => 'soundcloud' |
| 1635 | ], |
| 1636 | 'classes' => $this->pro_class, |
| 1637 | ] |
| 1638 | ); |
| 1639 | } |
| 1640 | //End SoundCloud controls |
| 1641 | |
| 1642 | /** |
| 1643 | * Vimeo Controls |
| 1644 | */ |
| 1645 | public function init_vimeo_controls() |
| 1646 | { |
| 1647 | |
| 1648 | |
| 1649 | |
| 1650 | $this->add_control( |
| 1651 | 'embedpress_pro_vimeo_color', |
| 1652 | [ |
| 1653 | 'label' => __('Scheme', 'embedpress'), |
| 1654 | 'type' => Controls_Manager::COLOR, |
| 1655 | 'label_block' => false, |
| 1656 | 'default' => '#00adef', |
| 1657 | 'condition' => [ |
| 1658 | 'emberpress_custom_player!' => 'yes', |
| 1659 | 'embedpress_pro_embeded_source' => 'vimeo' |
| 1660 | ] |
| 1661 | ] |
| 1662 | ); |
| 1663 | |
| 1664 | $this->add_control( |
| 1665 | 'embedpress_pro_vimeo_author_options', |
| 1666 | [ |
| 1667 | 'label' => __('Author Information', 'embedpress'), |
| 1668 | 'type' => Controls_Manager::HEADING, |
| 1669 | 'separator' => 'before', |
| 1670 | 'condition' => [ |
| 1671 | 'embedpress_pro_embeded_source' => 'vimeo', |
| 1672 | 'emberpress_custom_player!' => 'yes', |
| 1673 | ] |
| 1674 | ] |
| 1675 | ); |
| 1676 | |
| 1677 | $this->add_control( |
| 1678 | 'embedpress_pro_vimeo_display_title', |
| 1679 | [ |
| 1680 | 'label' => __('Title', 'embedpress'), |
| 1681 | 'type' => Controls_Manager::SWITCHER, |
| 1682 | 'label_block' => false, |
| 1683 | 'return_value' => 'yes', |
| 1684 | 'default' => 'yes', |
| 1685 | 'condition' => [ |
| 1686 | 'emberpress_custom_player!' => 'yes', |
| 1687 | 'embedpress_pro_embeded_source' => 'vimeo' |
| 1688 | ] |
| 1689 | ] |
| 1690 | ); |
| 1691 | |
| 1692 | //----- Vimeo PRO controls |
| 1693 | |
| 1694 | $this->add_control( |
| 1695 | 'embedpress_pro_vimeo_display_author', |
| 1696 | [ |
| 1697 | 'label' => __('Author', 'embedpress'), |
| 1698 | 'type' => Controls_Manager::SWITCHER, |
| 1699 | 'label_block' => false, |
| 1700 | 'return_value' => 'yes', |
| 1701 | 'default' => 'yes', |
| 1702 | 'condition' => [ |
| 1703 | 'emberpress_custom_player!' => 'yes', |
| 1704 | 'embedpress_pro_embeded_source' => 'vimeo' |
| 1705 | ], |
| 1706 | ] |
| 1707 | ); |
| 1708 | |
| 1709 | $this->add_control( |
| 1710 | 'embedpress_pro_vimeo_avatar', |
| 1711 | [ |
| 1712 | 'label' => __('Avatar', 'embedpress'), |
| 1713 | 'type' => Controls_Manager::SWITCHER, |
| 1714 | 'label_block' => false, |
| 1715 | 'return_value' => 'yes', |
| 1716 | 'default' => 'yes', |
| 1717 | 'condition' => [ |
| 1718 | 'emberpress_custom_player!' => 'yes', |
| 1719 | 'embedpress_pro_embeded_source' => 'vimeo' |
| 1720 | ], |
| 1721 | ] |
| 1722 | ); |
| 1723 | |
| 1724 | $this->add_control( |
| 1725 | 'embedpress_pro_vimeo_loop', |
| 1726 | [ |
| 1727 | 'label' => sprintf(__('Loop %s', 'embedpress'), $this->pro_text), |
| 1728 | 'type' => Controls_Manager::SWITCHER, |
| 1729 | 'label_block' => false, |
| 1730 | 'return_value' => 'yes', |
| 1731 | 'default' => 'no', |
| 1732 | 'condition' => [ |
| 1733 | 'emberpress_custom_player!' => 'yes', |
| 1734 | 'embedpress_pro_embeded_source' => 'vimeo' |
| 1735 | ], |
| 1736 | 'classes' => $this->pro_class, |
| 1737 | ] |
| 1738 | ); |
| 1739 | |
| 1740 | $this->init_branding_controls('vimeo'); |
| 1741 | } |
| 1742 | //End Vimeo controls |
| 1743 | |
| 1744 | |
| 1745 | /** |
| 1746 | * Spotify Controls |
| 1747 | */ |
| 1748 | public function init_spotify_controls() |
| 1749 | { |
| 1750 | $condition = [ |
| 1751 | 'embedpress_pro_embeded_source' => 'spotify' |
| 1752 | ]; |
| 1753 | |
| 1754 | $this->add_control( |
| 1755 | 'spotify_theme', |
| 1756 | [ |
| 1757 | 'label' => __('Player Background', 'embedpress'), |
| 1758 | 'description' => __('Dynamic option will use the most vibrant color from the album art.', 'embedpress'), |
| 1759 | 'type' => Controls_Manager::SELECT, |
| 1760 | 'label_block' => false, |
| 1761 | 'default' => '1', |
| 1762 | 'options' => [ |
| 1763 | '1' => __('Dynamic', 'embedpress'), |
| 1764 | '0' => __('Black & White', 'embedpress') |
| 1765 | ], |
| 1766 | 'condition' => $condition |
| 1767 | ] |
| 1768 | ); |
| 1769 | } |
| 1770 | //End Spotify controls |
| 1771 | |
| 1772 | /** |
| 1773 | * OpenSea Controls |
| 1774 | */ |
| 1775 | public function init_opensea_control() |
| 1776 | { |
| 1777 | $condition = [ |
| 1778 | 'embedpress_pro_embeded_source' => 'opensea' |
| 1779 | ]; |
| 1780 | |
| 1781 | $this->add_control( |
| 1782 | 'limit', |
| 1783 | [ |
| 1784 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 1785 | 'label' => esc_html__('Limit', 'embedpress'), |
| 1786 | 'placeholder' => '9', |
| 1787 | 'min' => 1, |
| 1788 | 'max' => 100, |
| 1789 | 'step' => 1, |
| 1790 | 'default' => 20, |
| 1791 | 'condition' => [ |
| 1792 | 'embedpress_pro_embeded_nft_type' => ['collection'], |
| 1793 | 'embedpress_pro_embeded_source!' => [ |
| 1794 | 'default', |
| 1795 | 'youtube', |
| 1796 | 'vimeo', |
| 1797 | 'dailymotion', |
| 1798 | 'wistia', |
| 1799 | 'twitch', |
| 1800 | 'soundcloud', |
| 1801 | 'instafeed', |
| 1802 | 'calendly', |
| 1803 | 'selfhosted_video', |
| 1804 | 'selfhosted_audio', |
| 1805 | 'spreaker', |
| 1806 | ], |
| 1807 | ], |
| 1808 | ] |
| 1809 | ); |
| 1810 | |
| 1811 | |
| 1812 | $this->add_control( |
| 1813 | 'orderby', |
| 1814 | [ |
| 1815 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 1816 | 'label' => esc_html__('Order By', 'embedpress'), |
| 1817 | 'options' => [ |
| 1818 | 'asc' => esc_html__('Oldest', 'embedpress'), |
| 1819 | 'desc' => esc_html__('Newest', 'embedpress'), |
| 1820 | ], |
| 1821 | 'default' => 'desc', |
| 1822 | 'condition' => [ |
| 1823 | 'embedpress_pro_embeded_nft_type' => ['collection'], |
| 1824 | 'embedpress_pro_embeded_source!' => [ |
| 1825 | 'default', |
| 1826 | 'youtube', |
| 1827 | 'vimeo', |
| 1828 | 'dailymotion', |
| 1829 | 'wistia', |
| 1830 | 'twitch', |
| 1831 | 'soundcloud', |
| 1832 | 'instafeed', |
| 1833 | 'calendly', |
| 1834 | 'selfhosted_video', |
| 1835 | 'selfhosted_audio', |
| 1836 | 'spreaker', |
| 1837 | |
| 1838 | ], |
| 1839 | ], |
| 1840 | ] |
| 1841 | ); |
| 1842 | } |
| 1843 | |
| 1844 | public function init_opensea_control_section() |
| 1845 | { |
| 1846 | $condition = [ |
| 1847 | 'embedpress_pro_embeded_source' => 'opensea', |
| 1848 | ]; |
| 1849 | |
| 1850 | $this->start_controls_section( |
| 1851 | 'embedpress_opensea_control_section', |
| 1852 | [ |
| 1853 | 'label' => __('OpenSea Control Settings', 'embedpress'), |
| 1854 | 'condition' => $condition, |
| 1855 | ] |
| 1856 | ); |
| 1857 | |
| 1858 | $this->add_control( |
| 1859 | 'opense_important_note_single', |
| 1860 | [ |
| 1861 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 1862 | 'raw' => esc_html__('These options take effect only when a Opensea Single Asset is embedded.', 'embedpress'), |
| 1863 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 1864 | 'condition' => [ |
| 1865 | 'embedpress_pro_embeded_nft_type' => 'single' |
| 1866 | ], |
| 1867 | |
| 1868 | ] |
| 1869 | ); |
| 1870 | $this->add_control( |
| 1871 | 'opense_important_note_collection', |
| 1872 | [ |
| 1873 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 1874 | 'raw' => esc_html__('These options take effect only when a Opensea Collection is embedded.', 'embedpress'), |
| 1875 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 1876 | 'condition' => [ |
| 1877 | 'embedpress_pro_embeded_nft_type' => 'collection' |
| 1878 | ], |
| 1879 | ] |
| 1880 | ); |
| 1881 | |
| 1882 | $this->add_control( |
| 1883 | 'layout', |
| 1884 | [ |
| 1885 | 'label' => __('Layout', 'embedpress'), |
| 1886 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 1887 | 'label_block' => false, |
| 1888 | 'default' => 'ep-grid', |
| 1889 | 'options' => [ |
| 1890 | 'ep-grid' => esc_html__('Grid', 'embedpress'), |
| 1891 | 'ep-list' => esc_html__('List', 'embedpress'), |
| 1892 | ], |
| 1893 | 'conditions' => [ |
| 1894 | 'terms' => [ |
| 1895 | [ |
| 1896 | 'name' => 'embedpress_pro_embeded_nft_type', |
| 1897 | 'operator' => '===', |
| 1898 | 'value' => 'collection', |
| 1899 | ], |
| 1900 | ], |
| 1901 | ] |
| 1902 | |
| 1903 | ] |
| 1904 | ); |
| 1905 | |
| 1906 | |
| 1907 | $this->add_control( |
| 1908 | 'preset', |
| 1909 | [ |
| 1910 | 'label' => __('Preset', 'embedpress'), |
| 1911 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 1912 | 'label_block' => false, |
| 1913 | 'default' => 'ep-preset-1', |
| 1914 | 'options' => [ |
| 1915 | 'ep-preset-1' => esc_html__('Preset 1', 'embedpress'), |
| 1916 | 'ep-preset-2' => esc_html__('Preset 2', 'embedpress'), |
| 1917 | ], |
| 1918 | 'conditions' => [ |
| 1919 | 'terms' => [ |
| 1920 | [ |
| 1921 | 'name' => 'embedpress_pro_embeded_nft_type', |
| 1922 | 'operator' => '===', |
| 1923 | 'value' => 'collection', |
| 1924 | 'relation' => 'and' |
| 1925 | ], |
| 1926 | [ |
| 1927 | 'name' => 'layout', |
| 1928 | 'operator' => '===', |
| 1929 | 'value' => 'ep-grid', |
| 1930 | 'relation' => 'and' |
| 1931 | ], |
| 1932 | ], |
| 1933 | ] |
| 1934 | |
| 1935 | ] |
| 1936 | ); |
| 1937 | |
| 1938 | $this->add_control( |
| 1939 | 'nftperrow', |
| 1940 | [ |
| 1941 | 'label' => __('Column', 'embedpress'), |
| 1942 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 1943 | 'label_block' => false, |
| 1944 | 'default' => '3', |
| 1945 | 'options' => [ |
| 1946 | '1' => esc_html__('1', 'embedpress'), |
| 1947 | '2' => esc_html__('2', 'embedpress'), |
| 1948 | '3' => esc_html__('3', 'embedpress'), |
| 1949 | '4' => esc_html__('4', 'embedpress'), |
| 1950 | '5' => esc_html__('5', 'embedpress'), |
| 1951 | '6' => esc_html__('6', 'embedpress'), |
| 1952 | 'auto' => esc_html__('Auto', 'embedpress'), |
| 1953 | ], |
| 1954 | 'condition' => [ |
| 1955 | 'embedpress_pro_embeded_nft_type' => ['collection'] |
| 1956 | ], |
| 1957 | |
| 1958 | ] |
| 1959 | ); |
| 1960 | |
| 1961 | $this->add_control( |
| 1962 | 'gapbetweenitem', |
| 1963 | [ |
| 1964 | 'label' => esc_html__('Gap Between Item', 'embedpress'), |
| 1965 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 1966 | 'size_units' => ['px'], |
| 1967 | 'range' => [ |
| 1968 | 'px' => [ |
| 1969 | 'min' => 1, |
| 1970 | 'max' => 100, |
| 1971 | 'step' => 1, |
| 1972 | ], |
| 1973 | ], |
| 1974 | 'default' => [ |
| 1975 | 'unit' => 'px', |
| 1976 | 'size' => 15, |
| 1977 | ], |
| 1978 | 'condition' => [ |
| 1979 | 'embedpress_pro_embeded_nft_type' => ['collection'] |
| 1980 | ], |
| 1981 | ] |
| 1982 | ); |
| 1983 | |
| 1984 | $this->add_control( |
| 1985 | 'collectionname', |
| 1986 | [ |
| 1987 | 'label' => __('Collection Name', 'embedpress'), |
| 1988 | 'type' => Controls_Manager::SWITCHER, |
| 1989 | 'label_block' => false, |
| 1990 | 'return_value' => 'yes', |
| 1991 | 'label_off' => __('Hide', 'embedpress'), |
| 1992 | 'label_on' => __('Show', 'embedpress'), |
| 1993 | 'default' => 'yes', |
| 1994 | 'condition' => [ |
| 1995 | 'embedpress_pro_embeded_nft_type' => 'single' |
| 1996 | ], |
| 1997 | ] |
| 1998 | ); |
| 1999 | $this->add_control( |
| 2000 | 'nftimage', |
| 2001 | [ |
| 2002 | 'label' => __('Thumbnail', 'embedpress'), |
| 2003 | 'type' => Controls_Manager::SWITCHER, |
| 2004 | 'label_block' => false, |
| 2005 | 'return_value' => 'yes', |
| 2006 | 'label_off' => __('Hide', 'embedpress'), |
| 2007 | 'label_on' => __('Show', 'embedpress'), |
| 2008 | 'default' => 'yes', |
| 2009 | 'condition' => $condition, |
| 2010 | ] |
| 2011 | ); |
| 2012 | $this->add_control( |
| 2013 | 'nfttitle', |
| 2014 | [ |
| 2015 | 'label' => __('Title', 'embedpress'), |
| 2016 | 'type' => Controls_Manager::SWITCHER, |
| 2017 | 'label_block' => false, |
| 2018 | 'return_value' => 'yes', |
| 2019 | 'default' => '', |
| 2020 | 'label_off' => __('Hide', 'embedpress'), |
| 2021 | 'label_on' => __('Show', 'embedpress'), |
| 2022 | 'default' => 'yes', |
| 2023 | 'condition' => $condition, |
| 2024 | ] |
| 2025 | ); |
| 2026 | $this->add_control( |
| 2027 | 'nftcreator', |
| 2028 | [ |
| 2029 | 'label' => __('Creator', 'embedpress'), |
| 2030 | 'type' => Controls_Manager::SWITCHER, |
| 2031 | 'label_block' => false, |
| 2032 | 'return_value' => 'yes', |
| 2033 | 'default' => '', |
| 2034 | 'label_off' => __('Hide', 'embedpress'), |
| 2035 | 'label_on' => __('Show', 'embedpress'), |
| 2036 | 'default' => 'yes', |
| 2037 | 'condition' => $condition, |
| 2038 | ] |
| 2039 | ); |
| 2040 | |
| 2041 | $this->add_control( |
| 2042 | 'prefix_nftcreator', |
| 2043 | [ |
| 2044 | 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text), |
| 2045 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 2046 | 'default' => esc_html__('Created By', 'embedpress'), |
| 2047 | 'placeholder' => esc_html__('Created By', 'embedpress'), |
| 2048 | 'classes' => $this->pro_class, |
| 2049 | 'condition' => [ |
| 2050 | 'nftcreator' => 'yes', |
| 2051 | ] |
| 2052 | ] |
| 2053 | ); |
| 2054 | |
| 2055 | $this->add_control( |
| 2056 | 'nftprice', |
| 2057 | [ |
| 2058 | 'label' => __('Current Price', 'embedpress'), |
| 2059 | 'type' => Controls_Manager::SWITCHER, |
| 2060 | 'label_block' => false, |
| 2061 | 'return_value' => 'yes', |
| 2062 | 'default' => '', |
| 2063 | 'label_off' => __('Hide', 'embedpress'), |
| 2064 | 'label_on' => __('Show', 'embedpress'), |
| 2065 | 'default' => 'yes', |
| 2066 | 'condition' => $condition, |
| 2067 | ] |
| 2068 | ); |
| 2069 | |
| 2070 | $this->add_control( |
| 2071 | 'prefix_nftprice', |
| 2072 | [ |
| 2073 | 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text), |
| 2074 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 2075 | 'default' => esc_html__('Current Price', 'embedpress'), |
| 2076 | 'placeholder' => esc_html__('Current Price', 'embedpress'), |
| 2077 | 'classes' => $this->pro_class, |
| 2078 | 'condition' => [ |
| 2079 | 'nftprice' => 'yes', |
| 2080 | ] |
| 2081 | ] |
| 2082 | ); |
| 2083 | |
| 2084 | $this->add_control( |
| 2085 | 'nftlastsale', |
| 2086 | [ |
| 2087 | 'label' => __('Last Sale', 'embedpress'), |
| 2088 | 'type' => Controls_Manager::SWITCHER, |
| 2089 | 'label_block' => false, |
| 2090 | 'return_value' => 'yes', |
| 2091 | 'default' => '', |
| 2092 | 'label_off' => __('Hide', 'embedpress'), |
| 2093 | 'label_on' => __('Show', 'embedpress'), |
| 2094 | 'default' => 'yes', |
| 2095 | 'condition' => $condition, |
| 2096 | ] |
| 2097 | ); |
| 2098 | |
| 2099 | $this->add_control( |
| 2100 | 'prefix_nftlastsale', |
| 2101 | [ |
| 2102 | 'label' => sprintf(__('Prefix %s', 'embedpress'), $this->pro_text), |
| 2103 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 2104 | 'default' => esc_html__('Last Sale', 'embedpress'), |
| 2105 | 'placeholder' => esc_html__('Last Sale', 'embedpress'), |
| 2106 | 'classes' => $this->pro_class, |
| 2107 | 'condition' => [ |
| 2108 | 'nftlastsale' => 'yes', |
| 2109 | ] |
| 2110 | ] |
| 2111 | ); |
| 2112 | |
| 2113 | $this->add_control( |
| 2114 | 'nftbutton', |
| 2115 | [ |
| 2116 | 'label' => __('Button', 'embedpress'), |
| 2117 | 'type' => Controls_Manager::SWITCHER, |
| 2118 | 'label_block' => false, |
| 2119 | 'return_value' => 'yes', |
| 2120 | 'default' => '', |
| 2121 | 'label_off' => __('Hide', 'embedpress'), |
| 2122 | 'label_on' => __('Show', 'embedpress'), |
| 2123 | 'default' => 'yes', |
| 2124 | 'condition' => $condition, |
| 2125 | ] |
| 2126 | ); |
| 2127 | $this->add_control( |
| 2128 | 'label_nftbutton', |
| 2129 | [ |
| 2130 | 'label' => sprintf(__('Button Label %s', 'embedpress'), $this->pro_text), |
| 2131 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 2132 | 'default' => esc_html__('See Details', 'embedpress'), |
| 2133 | 'placeholder' => esc_html__('See Details', 'embedpress'), |
| 2134 | 'classes' => $this->pro_class, |
| 2135 | 'condition' => [ |
| 2136 | 'nftbutton' => 'yes', |
| 2137 | ] |
| 2138 | ] |
| 2139 | ); |
| 2140 | |
| 2141 | $this->add_control( |
| 2142 | 'loadmore', |
| 2143 | [ |
| 2144 | 'label' => sprintf(__('Load More %s', 'embedpress'), $this->pro_text), |
| 2145 | 'type' => Controls_Manager::SWITCHER, |
| 2146 | 'label_block' => false, |
| 2147 | 'return_value' => 'yes', |
| 2148 | 'default' => '', |
| 2149 | 'label_off' => __('Hide', 'embedpress'), |
| 2150 | 'label_on' => __('Show', 'embedpress'), |
| 2151 | 'default' => '', |
| 2152 | 'classes' => $this->pro_class, |
| 2153 | 'condition' => [ |
| 2154 | 'embedpress_pro_embeded_nft_type' => ['collection'] |
| 2155 | ], |
| 2156 | ] |
| 2157 | ); |
| 2158 | $this->add_control( |
| 2159 | 'itemperpage', |
| 2160 | [ |
| 2161 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 2162 | 'label' => esc_html__('Item Per Page', 'embedpress'), |
| 2163 | 'placeholder' => '9', |
| 2164 | 'min' => 1, |
| 2165 | 'max' => 100, |
| 2166 | 'step' => 1, |
| 2167 | 'default' => 9, |
| 2168 | 'condition' => [ |
| 2169 | 'loadmore' => 'yes' |
| 2170 | ], |
| 2171 | ] |
| 2172 | ); |
| 2173 | $this->add_control( |
| 2174 | 'loadmorelabel', |
| 2175 | [ |
| 2176 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 2177 | 'label' => esc_html__('Load More Label', 'embedpress'), |
| 2178 | 'placeholder' => 'Load More', |
| 2179 | 'default' => 'Load More', |
| 2180 | 'condition' => [ |
| 2181 | 'loadmore' => 'yes' |
| 2182 | ], |
| 2183 | ] |
| 2184 | ); |
| 2185 | |
| 2186 | $this->add_control( |
| 2187 | 'nftrank', |
| 2188 | [ |
| 2189 | 'label' => __('Rank', 'embedpress'), |
| 2190 | 'type' => Controls_Manager::SWITCHER, |
| 2191 | 'label_block' => false, |
| 2192 | 'return_value' => 'yes', |
| 2193 | 'label_off' => __('Hide', 'embedpress'), |
| 2194 | 'label_on' => __('Show', 'embedpress'), |
| 2195 | 'default' => 'yes', |
| 2196 | 'condition' => [ |
| 2197 | 'embedpress_pro_embeded_nft_type' => 'single' |
| 2198 | ], |
| 2199 | ] |
| 2200 | ); |
| 2201 | $this->add_control( |
| 2202 | 'label_nftrank', |
| 2203 | [ |
| 2204 | 'label' => sprintf(__('Rank Label %s', 'embedpress'), $this->pro_text), |
| 2205 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 2206 | 'default' => esc_html__('Rank', 'embedpress'), |
| 2207 | 'placeholder' => esc_html__('Rank', 'embedpress'), |
| 2208 | 'classes' => $this->pro_class, |
| 2209 | 'condition' => [ |
| 2210 | 'nftrank' => 'yes', |
| 2211 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2212 | ] |
| 2213 | ] |
| 2214 | ); |
| 2215 | |
| 2216 | $this->add_control( |
| 2217 | 'nftdetails', |
| 2218 | [ |
| 2219 | 'label' => __('Details', 'embedpress'), |
| 2220 | 'type' => Controls_Manager::SWITCHER, |
| 2221 | 'label_block' => false, |
| 2222 | 'return_value' => 'yes', |
| 2223 | 'label_off' => __('Hide', 'embedpress'), |
| 2224 | 'label_on' => __('Show', 'embedpress'), |
| 2225 | 'default' => 'yes', |
| 2226 | 'condition' => [ |
| 2227 | 'embedpress_pro_embeded_nft_type' => 'single' |
| 2228 | ], |
| 2229 | ] |
| 2230 | ); |
| 2231 | |
| 2232 | $this->add_control( |
| 2233 | 'label_nftdetails', |
| 2234 | [ |
| 2235 | 'label' => sprintf(__('Details Label %s', 'embedpress'), $this->pro_text), |
| 2236 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 2237 | 'default' => esc_html__('Details', 'embedpress'), |
| 2238 | 'placeholder' => esc_html__('Details', 'embedpress'), |
| 2239 | 'classes' => $this->pro_class, |
| 2240 | 'condition' => [ |
| 2241 | 'nftdetails' => 'yes', |
| 2242 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2243 | ] |
| 2244 | ] |
| 2245 | ); |
| 2246 | |
| 2247 | $this->end_controls_section(); |
| 2248 | } |
| 2249 | |
| 2250 | public function init_opensea_color_and_typography() |
| 2251 | { |
| 2252 | $condition = [ |
| 2253 | 'embedpress_pro_embeded_source' => 'opensea', |
| 2254 | ]; |
| 2255 | |
| 2256 | $this->start_controls_section( |
| 2257 | 'embedpress_color_typography_control_section', |
| 2258 | [ |
| 2259 | 'label' => __('Color and Typography', 'embedpress'), |
| 2260 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2261 | 'condition' => $condition, |
| 2262 | ] |
| 2263 | ); |
| 2264 | |
| 2265 | $this->add_control( |
| 2266 | 'opense_color_important_note_single', |
| 2267 | [ |
| 2268 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 2269 | 'raw' => esc_html__('These options take effect only when a Opensea Single Asset is embedded.', 'embedpress'), |
| 2270 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 2271 | 'condition' => [ |
| 2272 | 'embedpress_pro_embeded_nft_type' => 'single' |
| 2273 | ], |
| 2274 | |
| 2275 | ] |
| 2276 | ); |
| 2277 | $this->add_control( |
| 2278 | 'opense_color_important_note_collection', |
| 2279 | [ |
| 2280 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 2281 | 'raw' => esc_html__('These options take effect only when a Opensea Collection is embedded.', 'embedpress'), |
| 2282 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 2283 | 'condition' => [ |
| 2284 | 'embedpress_pro_embeded_nft_type' => 'collection' |
| 2285 | ], |
| 2286 | ] |
| 2287 | ); |
| 2288 | |
| 2289 | |
| 2290 | $this->add_control( |
| 2291 | 'item_heading', |
| 2292 | [ |
| 2293 | 'label' => esc_html__('Item', 'embedpress'), |
| 2294 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2295 | 'separator' => 'before', |
| 2296 | ] |
| 2297 | ); |
| 2298 | |
| 2299 | $this->add_control( |
| 2300 | 'nft_item_background_color', |
| 2301 | [ |
| 2302 | 'label' => esc_html__('Background Color', 'embedpress'), |
| 2303 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2304 | 'selectors' => [ |
| 2305 | '{{WRAPPER}} .ep_nft_content_wrap .ep_nft_item' => 'background-color: {{VALUE}}', |
| 2306 | ], |
| 2307 | ] |
| 2308 | ); |
| 2309 | |
| 2310 | $this->add_control( |
| 2311 | 'collectionname_heading', |
| 2312 | [ |
| 2313 | 'label' => esc_html__('Collection Name', 'embedpress'), |
| 2314 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2315 | 'separator' => 'before', |
| 2316 | ] |
| 2317 | ); |
| 2318 | |
| 2319 | $this->add_control( |
| 2320 | 'nft_collectionname_color', |
| 2321 | [ |
| 2322 | 'label' => esc_html__('Color', 'embedpress'), |
| 2323 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2324 | 'selectors' => [ |
| 2325 | '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link' => 'color: {{VALUE}}', |
| 2326 | ], |
| 2327 | ] |
| 2328 | ); |
| 2329 | $this->add_control( |
| 2330 | 'nft_collectionname_hover_color', |
| 2331 | [ |
| 2332 | 'label' => esc_html__('Hove Color', 'embedpress'), |
| 2333 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2334 | 'selectors' => [ |
| 2335 | '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link:hover' => 'color: {{VALUE}}', |
| 2336 | ], |
| 2337 | ] |
| 2338 | ); |
| 2339 | $this->add_group_control( |
| 2340 | \Elementor\Group_Control_Typography::get_type(), |
| 2341 | [ |
| 2342 | 'name' => 'nft_collectionname_typography', |
| 2343 | 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper a.CollectionLink--link', |
| 2344 | ] |
| 2345 | ); |
| 2346 | |
| 2347 | $this->add_control( |
| 2348 | 'title_heading', |
| 2349 | [ |
| 2350 | 'label' => esc_html__('Title', 'embedpress'), |
| 2351 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2352 | 'separator' => 'before', |
| 2353 | ] |
| 2354 | ); |
| 2355 | |
| 2356 | $this->add_control( |
| 2357 | 'nft_title_color', |
| 2358 | [ |
| 2359 | 'label' => esc_html__('Color', 'embedpress'), |
| 2360 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2361 | 'selectors' => [ |
| 2362 | '{{WRAPPER}} .ep_nft_title' => 'color: {{VALUE}}', |
| 2363 | ], |
| 2364 | ] |
| 2365 | ); |
| 2366 | $this->add_group_control( |
| 2367 | \Elementor\Group_Control_Typography::get_type(), |
| 2368 | [ |
| 2369 | 'name' => 'nft_title_typography', |
| 2370 | 'selector' => '{{WRAPPER}} .ep_nft_title', |
| 2371 | ] |
| 2372 | ); |
| 2373 | |
| 2374 | |
| 2375 | $this->add_control( |
| 2376 | 'creator_heading', |
| 2377 | [ |
| 2378 | 'label' => esc_html__('Creator', 'embedpress'), |
| 2379 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2380 | 'separator' => 'before', |
| 2381 | ] |
| 2382 | ); |
| 2383 | |
| 2384 | $this->add_control( |
| 2385 | 'nft_creator_color', |
| 2386 | [ |
| 2387 | 'label' => esc_html__('Color', 'embedpress'), |
| 2388 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2389 | 'selectors' => [ |
| 2390 | '{{WRAPPER}} .ep_nft_creator span' => 'color: {{VALUE}}', |
| 2391 | ], |
| 2392 | ] |
| 2393 | ); |
| 2394 | $this->add_group_control( |
| 2395 | \Elementor\Group_Control_Typography::get_type(), |
| 2396 | [ |
| 2397 | 'name' => 'nft_creator_typography', |
| 2398 | 'selector' => '{{WRAPPER}} .ep_nft_creator span', |
| 2399 | ] |
| 2400 | ); |
| 2401 | |
| 2402 | $this->add_control( |
| 2403 | 'nft_created_by_color', |
| 2404 | [ |
| 2405 | 'label' => esc_html__('Link Color', 'embedpress'), |
| 2406 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2407 | 'selectors' => [ |
| 2408 | '{{WRAPPER}} .ep_nft_creator span a' => 'color: {{VALUE}}', |
| 2409 | ], |
| 2410 | ] |
| 2411 | ); |
| 2412 | $this->add_group_control( |
| 2413 | \Elementor\Group_Control_Typography::get_type(), |
| 2414 | [ |
| 2415 | 'label' => esc_html__('Link Typography', 'embedpress'), |
| 2416 | 'name' => 'nft_created_by_typography', |
| 2417 | 'selector' => '{{WRAPPER}} .ep_nft_creator span a', |
| 2418 | ] |
| 2419 | ); |
| 2420 | |
| 2421 | $this->add_control( |
| 2422 | 'price_heading', |
| 2423 | [ |
| 2424 | 'label' => esc_html__('Current Price', 'embedpress'), |
| 2425 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2426 | 'separator' => 'before', |
| 2427 | ] |
| 2428 | ); |
| 2429 | |
| 2430 | $this->add_control( |
| 2431 | 'nft_price_color', |
| 2432 | [ |
| 2433 | 'label' => esc_html__('Color', 'embedpress'), |
| 2434 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2435 | 'selectors' => [ |
| 2436 | '{{WRAPPER}} .ep_current_price span' => 'color: {{VALUE}}', |
| 2437 | ], |
| 2438 | ] |
| 2439 | ); |
| 2440 | |
| 2441 | $this->add_group_control( |
| 2442 | \Elementor\Group_Control_Typography::get_type(), |
| 2443 | [ |
| 2444 | 'name' => 'nft_price_typography', |
| 2445 | 'selector' => '{{WRAPPER}} .ep_current_price span', |
| 2446 | ] |
| 2447 | ); |
| 2448 | $this->add_control( |
| 2449 | 'last_sale_heading', |
| 2450 | [ |
| 2451 | 'label' => esc_html__('Last Sale Price', 'embedpress'), |
| 2452 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2453 | 'separator' => 'before', |
| 2454 | ] |
| 2455 | ); |
| 2456 | |
| 2457 | $this->add_control( |
| 2458 | 'nft_last_sale_color', |
| 2459 | [ |
| 2460 | 'label' => esc_html__('Color', 'embedpress'), |
| 2461 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2462 | 'selectors' => [ |
| 2463 | '{{WRAPPER}} .ep_nft_last_sale span' => 'color: {{VALUE}}', |
| 2464 | ], |
| 2465 | ] |
| 2466 | ); |
| 2467 | $this->add_group_control( |
| 2468 | \Elementor\Group_Control_Typography::get_type(), |
| 2469 | [ |
| 2470 | 'name' => 'nft_last_sale_typography', |
| 2471 | 'selector' => '{{WRAPPER}} .ep_nft_last_sale span', |
| 2472 | ] |
| 2473 | ); |
| 2474 | $this->add_control( |
| 2475 | 'nftbutton_heading', |
| 2476 | [ |
| 2477 | 'label' => esc_html__('Button', 'embedpress'), |
| 2478 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2479 | 'separator' => 'before', |
| 2480 | ] |
| 2481 | ); |
| 2482 | |
| 2483 | |
| 2484 | $this->add_control( |
| 2485 | 'nftbutton_color', |
| 2486 | [ |
| 2487 | 'label' => esc_html__('Color', 'embedpress'), |
| 2488 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2489 | 'selectors' => [ |
| 2490 | '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a' => 'color: {{VALUE}}', |
| 2491 | ], |
| 2492 | ] |
| 2493 | ); |
| 2494 | $this->add_control( |
| 2495 | 'nftbutton_bg_color', |
| 2496 | [ |
| 2497 | 'label' => esc_html__('Background Color', 'embedpress'), |
| 2498 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2499 | 'selectors' => [ |
| 2500 | '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a' => 'background-color: {{VALUE}}', |
| 2501 | ], |
| 2502 | ] |
| 2503 | ); |
| 2504 | $this->add_group_control( |
| 2505 | \Elementor\Group_Control_Typography::get_type(), |
| 2506 | [ |
| 2507 | 'name' => 'nftbutton_typography', |
| 2508 | 'selector' => '{{WRAPPER}} .ep-nft-gallery-wrapper.ep-nft-gallery-r1a5mbx .ep_nft_button a', |
| 2509 | ] |
| 2510 | ); |
| 2511 | $this->add_control( |
| 2512 | 'nft_loadmore_style', |
| 2513 | [ |
| 2514 | 'label' => esc_html__('Load More', 'embedpress'), |
| 2515 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2516 | 'separator' => 'before', |
| 2517 | 'condition' => [ |
| 2518 | 'loadmore' => 'yes', |
| 2519 | 'embedpress_pro_embeded_nft_type' => 'collection' |
| 2520 | ] |
| 2521 | ] |
| 2522 | ); |
| 2523 | |
| 2524 | $this->add_control( |
| 2525 | 'nft_loadmore_color', |
| 2526 | [ |
| 2527 | 'label' => esc_html__('Text Color', 'embedpress'), |
| 2528 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2529 | 'selectors' => [ |
| 2530 | '{{WRAPPER}} .nft-loadmore' => 'color: {{VALUE}}!important;', |
| 2531 | '{{WRAPPER}} .nft-loadmore svg' => 'fill: {{VALUE}}!important;', |
| 2532 | ], |
| 2533 | 'condition' => [ |
| 2534 | 'loadmore' => 'yes', |
| 2535 | 'embedpress_pro_embeded_nft_type' => 'collection' |
| 2536 | ] |
| 2537 | ] |
| 2538 | ); |
| 2539 | $this->add_group_control( |
| 2540 | \Elementor\Group_Control_Typography::get_type(), |
| 2541 | [ |
| 2542 | 'name' => 'nft_loadmore_typography', |
| 2543 | 'selector' => '{{WRAPPER}} .nft-loadmore, {{WRAPPER}} .nft-loadmore svg', |
| 2544 | 'condition' => [ |
| 2545 | 'loadmore' => 'yes', |
| 2546 | 'embedpress_pro_embeded_nft_type' => 'collection' |
| 2547 | ] |
| 2548 | ] |
| 2549 | ); |
| 2550 | $this->add_control( |
| 2551 | 'nft_loadmore_bgcolor', |
| 2552 | [ |
| 2553 | 'label' => esc_html__('Background Color', 'embedpress'), |
| 2554 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2555 | 'selectors' => [ |
| 2556 | '{{WRAPPER}} .nft-loadmore' => 'background-color: {{VALUE}}!important;', |
| 2557 | ], |
| 2558 | 'condition' => [ |
| 2559 | 'loadmore' => 'yes', |
| 2560 | 'embedpress_pro_embeded_nft_type' => 'collection' |
| 2561 | ] |
| 2562 | ] |
| 2563 | ); |
| 2564 | |
| 2565 | $this->add_control( |
| 2566 | 'nftrank_heading', |
| 2567 | [ |
| 2568 | 'label' => esc_html__('Rank', 'embedpress'), |
| 2569 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2570 | 'separator' => 'before', |
| 2571 | 'condition' => [ |
| 2572 | 'nftrank' => 'yes', |
| 2573 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2574 | ] |
| 2575 | ] |
| 2576 | ); |
| 2577 | |
| 2578 | $this->add_control( |
| 2579 | 'nftrank_label_color', |
| 2580 | [ |
| 2581 | 'label' => esc_html__('Label Color', 'embedpress'), |
| 2582 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2583 | 'selectors' => [ |
| 2584 | '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper' => 'color: {{VALUE}}!important;', |
| 2585 | ], |
| 2586 | 'condition' => [ |
| 2587 | 'nftrank' => 'yes', |
| 2588 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2589 | ] |
| 2590 | ] |
| 2591 | ); |
| 2592 | $this->add_group_control( |
| 2593 | \Elementor\Group_Control_Typography::get_type(), |
| 2594 | [ |
| 2595 | 'name' => 'nftrank_label_typography', |
| 2596 | 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper ', |
| 2597 | 'condition' => [ |
| 2598 | 'nftrank' => 'yes', |
| 2599 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2600 | ] |
| 2601 | ] |
| 2602 | ); |
| 2603 | $this->add_control( |
| 2604 | 'nftrank_color', |
| 2605 | [ |
| 2606 | 'label' => esc_html__('Rank Color', 'embedpress'), |
| 2607 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2608 | 'selectors' => [ |
| 2609 | '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank' => 'color: {{VALUE}}!important;', |
| 2610 | ], |
| 2611 | 'condition' => [ |
| 2612 | 'nftrank' => 'yes', |
| 2613 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2614 | ] |
| 2615 | ] |
| 2616 | ); |
| 2617 | $this->add_control( |
| 2618 | 'nftrank_border_color', |
| 2619 | [ |
| 2620 | 'label' => esc_html__('Border Color', 'embedpress'), |
| 2621 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2622 | 'selectors' => [ |
| 2623 | '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank' => 'border-color: {{VALUE}}!important', |
| 2624 | ], |
| 2625 | 'condition' => [ |
| 2626 | 'nftrank' => 'yes', |
| 2627 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2628 | ] |
| 2629 | ] |
| 2630 | ); |
| 2631 | $this->add_group_control( |
| 2632 | \Elementor\Group_Control_Typography::get_type(), |
| 2633 | [ |
| 2634 | 'name' => 'nftrank_typography', |
| 2635 | 'selector' => '{{WRAPPER}} .ep-nft-single-item-wraper .ep-nft-rank-wraper span.ep-nft-rank', |
| 2636 | 'condition' => [ |
| 2637 | 'nftrank' => 'yes', |
| 2638 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2639 | ] |
| 2640 | ] |
| 2641 | ); |
| 2642 | |
| 2643 | |
| 2644 | |
| 2645 | $this->add_control( |
| 2646 | 'nftdetails_heading', |
| 2647 | [ |
| 2648 | 'label' => esc_html__('Details', 'embedpress'), |
| 2649 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 2650 | 'separator' => 'before', |
| 2651 | 'condition' => [ |
| 2652 | 'nftrank' => 'yes', |
| 2653 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2654 | ] |
| 2655 | ] |
| 2656 | ); |
| 2657 | |
| 2658 | $this->add_control( |
| 2659 | 'nftdetail_title_color', |
| 2660 | [ |
| 2661 | 'label' => esc_html__('Title Color', 'embedpress'), |
| 2662 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2663 | 'selectors' => [ |
| 2664 | '{{WRAPPER}} .ep-title' => 'color: {{VALUE}}', |
| 2665 | ], |
| 2666 | 'condition' => [ |
| 2667 | 'nftrank' => 'yes', |
| 2668 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2669 | ] |
| 2670 | ] |
| 2671 | ); |
| 2672 | $this->add_group_control( |
| 2673 | \Elementor\Group_Control_Typography::get_type(), |
| 2674 | [ |
| 2675 | 'label' => esc_html__('Title Typography', 'embedpress'), |
| 2676 | 'name' => 'nftdetail_title_typography', |
| 2677 | 'selector' => '{{WRAPPER}} .ep-title', |
| 2678 | 'condition' => [ |
| 2679 | 'nftrank' => 'yes', |
| 2680 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2681 | ] |
| 2682 | ] |
| 2683 | ); |
| 2684 | |
| 2685 | $this->add_control( |
| 2686 | 'nftdetail_color', |
| 2687 | [ |
| 2688 | 'label' => esc_html__('Content Color', 'embedpress'), |
| 2689 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2690 | 'selectors' => [ |
| 2691 | '{{WRAPPER}} .ep-asset-detail-item' => 'color: {{VALUE}}', |
| 2692 | ], |
| 2693 | 'condition' => [ |
| 2694 | 'nftrank' => 'yes', |
| 2695 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2696 | ] |
| 2697 | ] |
| 2698 | ); |
| 2699 | $this->add_group_control( |
| 2700 | \Elementor\Group_Control_Typography::get_type(), |
| 2701 | [ |
| 2702 | 'label' => esc_html__('Content Typography', 'embedpress'), |
| 2703 | 'name' => 'nftdetail_typography', |
| 2704 | 'selector' => '{{WRAPPER}} .ep-asset-detail-item', |
| 2705 | 'condition' => [ |
| 2706 | 'nftrank' => 'yes', |
| 2707 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2708 | ] |
| 2709 | ] |
| 2710 | ); |
| 2711 | |
| 2712 | $this->add_control( |
| 2713 | 'nftdetail_link_color', |
| 2714 | [ |
| 2715 | 'label' => esc_html__('Link Color', 'embedpress'), |
| 2716 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2717 | 'selectors' => [ |
| 2718 | '{{WRAPPER}} .ep-asset-detail-item a' => 'color: {{VALUE}}', |
| 2719 | ], |
| 2720 | 'condition' => [ |
| 2721 | 'nftrank' => 'yes', |
| 2722 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2723 | ] |
| 2724 | ] |
| 2725 | ); |
| 2726 | $this->add_group_control( |
| 2727 | \Elementor\Group_Control_Typography::get_type(), |
| 2728 | [ |
| 2729 | 'name' => 'nftdetail_link_typography', |
| 2730 | 'selector' => '{{WRAPPER}} .ep-asset-detail-item a, .ep-asset-detail-item', |
| 2731 | 'condition' => [ |
| 2732 | 'nftrank' => 'yes', |
| 2733 | 'embedpress_pro_embeded_nft_type!' => 'collection' |
| 2734 | ] |
| 2735 | ] |
| 2736 | ); |
| 2737 | |
| 2738 | |
| 2739 | $this->end_controls_section(); |
| 2740 | } |
| 2741 | |
| 2742 | //End OpenSea controls |
| 2743 | |
| 2744 | |
| 2745 | |
| 2746 | /** |
| 2747 | * Instagram Feed Controls |
| 2748 | */ |
| 2749 | public function init_instafeed_control(){ |
| 2750 | $condition = [ |
| 2751 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 2752 | ]; |
| 2753 | $disableAi = [ |
| 2754 | 'active' => false, |
| 2755 | ]; |
| 2756 | |
| 2757 | $this->add_control( |
| 2758 | 'instaLayout', |
| 2759 | [ |
| 2760 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 2761 | 'label' => esc_html__( 'Layout', 'embedpress' ), |
| 2762 | 'options' => [ |
| 2763 | 'insta-grid' => esc_html__( 'Grid', 'embedpress' ), |
| 2764 | 'insta-masonry' => sprintf(__('Masonry%s', 'embedpress'), $this->pro_label), |
| 2765 | 'insta-carousel' => sprintf(__('Carousel%s', 'embedpress'), $this->pro_label), |
| 2766 | ], |
| 2767 | 'default' => 'insta-grid', |
| 2768 | 'condition' => $condition, |
| 2769 | ] |
| 2770 | ); |
| 2771 | |
| 2772 | if ( !apply_filters('embedpress/is_allow_rander', false) ) { |
| 2773 | $this->add_control( |
| 2774 | 'embedpress_insta_layout__pro_enable_warning', |
| 2775 | [ |
| 2776 | 'label' => sprintf( '<a style="color: red" target="_blank" href="https://wpdeveloper.com/in/upgrade-embedpress">%s</a>', |
| 2777 | esc_html__( 'Only Available in Pro Version!', 'essential-addons-for-elementor-lite' ) ), |
| 2778 | 'type' => Controls_Manager::RAW_HTML, |
| 2779 | 'condition' => [ |
| 2780 | 'instaLayout' => [ 'insta-masonry', 'insta-carousel' ], |
| 2781 | ], |
| 2782 | ] |
| 2783 | ); |
| 2784 | } |
| 2785 | |
| 2786 | $this->add_control( |
| 2787 | 'instafeedColumns', |
| 2788 | [ |
| 2789 | 'label' => __('Column', 'embedpress'), |
| 2790 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 2791 | 'label_block' => false, |
| 2792 | 'default' => '3', |
| 2793 | 'options' => [ |
| 2794 | '2' => esc_html__('2', 'embedpress'), |
| 2795 | '3' => esc_html__('3', 'embedpress'), |
| 2796 | '4' => esc_html__('4', 'embedpress'), |
| 2797 | '6' => esc_html__('6', 'embedpress'), |
| 2798 | 'auto' => esc_html__('Auto', 'embedpress'), |
| 2799 | ], |
| 2800 | 'condition' => [ |
| 2801 | 'instaLayout' => ['insta-grid', 'insta-masonry'], |
| 2802 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 2803 | ], |
| 2804 | ] |
| 2805 | ); |
| 2806 | |
| 2807 | $this->add_control( |
| 2808 | 'instafeedColumnsGap', |
| 2809 | [ |
| 2810 | 'label' => esc_html__( 'Column Gap', 'embedpress' ), |
| 2811 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 2812 | 'min' => 0, |
| 2813 | 'max' => 100, |
| 2814 | 'step' => 1, |
| 2815 | 'default' => 5, |
| 2816 | 'condition' => [ |
| 2817 | 'instaLayout' => [ 'insta-masonry', 'insta-grid' ], |
| 2818 | ], |
| 2819 | ] |
| 2820 | ); |
| 2821 | |
| 2822 | $this->add_control( |
| 2823 | 'embedpress_instafeed_slide_show', |
| 2824 | [ |
| 2825 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 2826 | 'label' => esc_html__( 'Slides to Show', 'embedpress' ), |
| 2827 | 'options' => [ |
| 2828 | '1' => esc_html__( '1', 'embedpress' ), |
| 2829 | '2' => esc_html__( '2', 'embedpress' ), |
| 2830 | '3' => esc_html__( '3', 'embedpress' ), |
| 2831 | '4' => esc_html__( '4', 'embedpress' ), |
| 2832 | '5' => esc_html__( '5', 'embedpress' ), |
| 2833 | '6' => esc_html__( '6', 'embedpress' ), |
| 2834 | '7' => esc_html__( '7', 'embedpress' ), |
| 2835 | '8' => esc_html__( '8', 'embedpress' ), |
| 2836 | '9' => esc_html__( '9', 'embedpress' ), |
| 2837 | '10' => esc_html__( '10', 'embedpress' ), |
| 2838 | ], |
| 2839 | 'default' => '5', |
| 2840 | 'condition' => [ |
| 2841 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 2842 | 'instaLayout' => 'insta-carousel' |
| 2843 | ], |
| 2844 | ] |
| 2845 | ); |
| 2846 | |
| 2847 | $this->add_control( |
| 2848 | 'embedpress_carousel_autoplay', |
| 2849 | [ |
| 2850 | 'label' => __('Auto Play', 'embedpress'), |
| 2851 | 'type' => Controls_Manager::SWITCHER, |
| 2852 | 'label_block' => false, |
| 2853 | 'return_value' => 'yes', |
| 2854 | 'default' => '', |
| 2855 | 'condition' => [ |
| 2856 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 2857 | 'instaLayout' => 'insta-carousel' |
| 2858 | ], |
| 2859 | ] |
| 2860 | ); |
| 2861 | $this->add_control( |
| 2862 | 'embedpress_carousel_autoplay_speed', |
| 2863 | [ |
| 2864 | 'label' => esc_html__( 'Autoplay Speed(ms)', 'embedpress' ), |
| 2865 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 2866 | 'min' => 0, |
| 2867 | 'step' => 1, |
| 2868 | 'default' => 0, |
| 2869 | 'condition' => [ |
| 2870 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 2871 | 'instaLayout' => 'insta-carousel' |
| 2872 | ], |
| 2873 | ] |
| 2874 | ); |
| 2875 | $this->add_control( |
| 2876 | 'embedpress_carousel_transition_speed', |
| 2877 | [ |
| 2878 | 'label' => esc_html__( 'Transition Speed(ms)', 'embedpress' ), |
| 2879 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 2880 | 'min' => 0, |
| 2881 | 'step' => 1, |
| 2882 | 'default' => 0, |
| 2883 | 'condition' => [ |
| 2884 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 2885 | 'instaLayout' => 'insta-carousel' |
| 2886 | ], |
| 2887 | ] |
| 2888 | ); |
| 2889 | $this->add_control( |
| 2890 | 'embedpress_carousel_loop', |
| 2891 | [ |
| 2892 | 'label' => __('Loop', 'embedpress'), |
| 2893 | 'type' => Controls_Manager::SWITCHER, |
| 2894 | 'label_block' => false, |
| 2895 | 'return_value' => 'yes', |
| 2896 | 'default' => 'yes', |
| 2897 | 'condition' => [ |
| 2898 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 2899 | 'instaLayout' => 'insta-carousel' |
| 2900 | ], |
| 2901 | ] |
| 2902 | ); |
| 2903 | |
| 2904 | $this->add_control( |
| 2905 | 'embedpress_carousel_arrows', |
| 2906 | [ |
| 2907 | 'label' => __('Arrows', 'embedpress'), |
| 2908 | 'type' => Controls_Manager::SWITCHER, |
| 2909 | 'label_block' => false, |
| 2910 | 'return_value' => 'yes', |
| 2911 | 'default' => 'yes', |
| 2912 | 'condition' => [ |
| 2913 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 2914 | 'instaLayout' => 'insta-carousel' |
| 2915 | ], |
| 2916 | ] |
| 2917 | ); |
| 2918 | |
| 2919 | |
| 2920 | $this->add_control( |
| 2921 | 'embedpress_carousel_spacing', |
| 2922 | [ |
| 2923 | 'label' => esc_html__( 'Spacing', 'embedpress' ), |
| 2924 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 2925 | 'min' => 0, |
| 2926 | 'max' => 100, |
| 2927 | 'step' => 1, |
| 2928 | 'default' => 0, |
| 2929 | 'condition' => [ |
| 2930 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 2931 | 'instaLayout' => 'insta-carousel' |
| 2932 | ], |
| 2933 | ] |
| 2934 | ); |
| 2935 | |
| 2936 | $this->add_control( |
| 2937 | 'instafeedPostsPerPage', |
| 2938 | [ |
| 2939 | 'label' => esc_html__( 'Posts Per Page', 'embedpress' ), |
| 2940 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 2941 | 'min' => 1, |
| 2942 | 'max' => 100, |
| 2943 | 'step' => 12, |
| 2944 | 'default' => 12, |
| 2945 | 'condition' => [ |
| 2946 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 2947 | ], |
| 2948 | ] |
| 2949 | ); |
| 2950 | |
| 2951 | $this->add_control( |
| 2952 | 'instafeedTab', |
| 2953 | [ |
| 2954 | 'label' => sprintf(__('Feed Tab %s', 'embedpress'), $this->pro_text), |
| 2955 | 'type' => Controls_Manager::SWITCHER, |
| 2956 | 'classes' => $this->pro_class, |
| 2957 | 'label_block' => false, |
| 2958 | 'return_value' => 'yes', |
| 2959 | 'default' => 'yes', |
| 2960 | 'condition' => $condition, |
| 2961 | ] |
| 2962 | ); |
| 2963 | |
| 2964 | $this->add_control( |
| 2965 | 'instafeedLikesCount', |
| 2966 | [ |
| 2967 | 'label' => sprintf(__('Like Count %s', 'embedpress'), $this->pro_text), |
| 2968 | 'type' => Controls_Manager::SWITCHER, |
| 2969 | 'classes' => $this->pro_class, |
| 2970 | 'label_block' => false, |
| 2971 | 'return_value' => 'true', |
| 2972 | 'default' => 'true', |
| 2973 | 'conditions' => [ |
| 2974 | 'relation' => 'or', |
| 2975 | 'terms' => [ |
| 2976 | [ |
| 2977 | 'name' => 'instafeedFeedType', |
| 2978 | 'operator' => '===', |
| 2979 | 'value' => 'hashtag_type', |
| 2980 | ], |
| 2981 | [ |
| 2982 | 'relation' => 'and', |
| 2983 | 'terms' => [ |
| 2984 | [ |
| 2985 | 'name' => 'instafeedAccountType', |
| 2986 | 'operator' => '===', |
| 2987 | 'value' => 'business', |
| 2988 | ], |
| 2989 | [ |
| 2990 | 'name' => 'embedpress_pro_embeded_source', |
| 2991 | 'operator' => '===', |
| 2992 | 'value' => 'instafeed', |
| 2993 | ], |
| 2994 | ], |
| 2995 | ], |
| 2996 | ], |
| 2997 | ], |
| 2998 | ] |
| 2999 | ); |
| 3000 | |
| 3001 | $this->add_control( |
| 3002 | 'instafeedCommentsCount', |
| 3003 | [ |
| 3004 | 'label' => sprintf(__('Comments Count %s', 'embedpress'), $this->pro_text), |
| 3005 | 'type' => Controls_Manager::SWITCHER, |
| 3006 | 'classes' => $this->pro_class, |
| 3007 | 'label_block' => false, |
| 3008 | 'return_value' => 'true', |
| 3009 | 'default' => 'true', |
| 3010 | |
| 3011 | 'conditions' => [ |
| 3012 | 'relation' => 'or', |
| 3013 | 'terms' => [ |
| 3014 | [ |
| 3015 | 'name' => 'instafeedFeedType', |
| 3016 | 'operator' => '===', |
| 3017 | 'value' => 'hashtag_type', |
| 3018 | ], |
| 3019 | [ |
| 3020 | 'relation' => 'and', |
| 3021 | 'terms' => [ |
| 3022 | [ |
| 3023 | 'name' => 'instafeedAccountType', |
| 3024 | 'operator' => '===', |
| 3025 | 'value' => 'business', |
| 3026 | ], |
| 3027 | [ |
| 3028 | 'name' => 'embedpress_pro_embeded_source', |
| 3029 | 'operator' => '===', |
| 3030 | 'value' => 'instafeed', |
| 3031 | ], |
| 3032 | ], |
| 3033 | ], |
| 3034 | ], |
| 3035 | ], |
| 3036 | |
| 3037 | ] |
| 3038 | ); |
| 3039 | |
| 3040 | |
| 3041 | $this->add_control( |
| 3042 | 'instafeedPopup', |
| 3043 | [ |
| 3044 | 'label' => __('Popup', 'embedpress'), |
| 3045 | 'type' => Controls_Manager::SWITCHER, |
| 3046 | 'label_block' => false, |
| 3047 | 'return_value' => 'yes', |
| 3048 | 'default' => 'yes', |
| 3049 | 'condition' => $condition, |
| 3050 | ] |
| 3051 | ); |
| 3052 | |
| 3053 | $this->add_control( |
| 3054 | 'instafeedPopupFollowBtn', |
| 3055 | [ |
| 3056 | 'label' => __('Popup Follow Button', 'embedpress'), |
| 3057 | 'type' => Controls_Manager::SWITCHER, |
| 3058 | 'label_block' => false, |
| 3059 | 'return_value' => 'yes', |
| 3060 | 'default' => 'yes', |
| 3061 | 'condition' => [ |
| 3062 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 3063 | 'instafeedPopup' => 'yes' |
| 3064 | ], |
| 3065 | ] |
| 3066 | ); |
| 3067 | |
| 3068 | $this->add_control( |
| 3069 | 'instafeedPopupFollowBtnLabel', |
| 3070 | [ |
| 3071 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 3072 | 'label' => esc_html__('Follow Button Label', 'embedpress'), |
| 3073 | 'placeholder' => 'Follow', |
| 3074 | 'default' => 'Follow', |
| 3075 | 'separator' => 'after', |
| 3076 | 'condition' => [ |
| 3077 | 'instafeedPopupFollowBtn' => 'yes', |
| 3078 | 'instafeedPopup' => 'yes', |
| 3079 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3080 | ], |
| 3081 | 'ai' => $disableAi |
| 3082 | ] |
| 3083 | ); |
| 3084 | |
| 3085 | $this->add_control( |
| 3086 | 'instafeedLoadmore', |
| 3087 | [ |
| 3088 | 'label' => __('Load More', 'embedpress'), |
| 3089 | 'type' => Controls_Manager::SWITCHER, |
| 3090 | 'label_block' => false, |
| 3091 | 'return_value' => 'yes', |
| 3092 | 'default' => 'yes', |
| 3093 | 'condition' => [ |
| 3094 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 3095 | 'instaLayout!' => 'insta-carousel' |
| 3096 | ], |
| 3097 | ] |
| 3098 | ); |
| 3099 | $this->add_control( |
| 3100 | 'instafeedLoadmoreLabel', |
| 3101 | [ |
| 3102 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 3103 | 'label' => esc_html__('Load More Button Label', 'embedpress'), |
| 3104 | 'placeholder' => 'Load More', |
| 3105 | 'default' => 'Load More', |
| 3106 | 'condition' => [ |
| 3107 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 3108 | 'instafeedLoadmore' => 'yes', |
| 3109 | 'instaLayout!' => 'insta-carousel' |
| 3110 | ], |
| 3111 | 'ai' => $disableAi |
| 3112 | ] |
| 3113 | ); |
| 3114 | |
| 3115 | } |
| 3116 | |
| 3117 | public function init_instafeed_control_section() |
| 3118 | { |
| 3119 | $condition = [ |
| 3120 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3121 | ]; |
| 3122 | $disableAi = [ |
| 3123 | 'active' => false, |
| 3124 | ]; |
| 3125 | |
| 3126 | $this->start_controls_section( |
| 3127 | 'embedpress_instafeed_profile_section', |
| 3128 | [ |
| 3129 | 'label' => __('Instagram Profile Settings', 'embedpress'), |
| 3130 | 'condition' => [ |
| 3131 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3132 | ], |
| 3133 | ] |
| 3134 | ); |
| 3135 | |
| 3136 | |
| 3137 | $this->add_control( |
| 3138 | 'instafeedProfileImage', |
| 3139 | [ |
| 3140 | 'label' => __('Profile Image', 'embedpress'), |
| 3141 | 'type' => Controls_Manager::SWITCHER, |
| 3142 | 'label_block' => false, |
| 3143 | 'return_value' => 'yes', |
| 3144 | 'default' => 'yes', |
| 3145 | 'condition' => [ |
| 3146 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3147 | ], |
| 3148 | ] |
| 3149 | ); |
| 3150 | |
| 3151 | $this->add_control( |
| 3152 | "instafeedProfileImageUrl", |
| 3153 | [ |
| 3154 | 'label' => sprintf(__('Image %s', 'embedpress'), $this->pro_text), |
| 3155 | 'type' => Controls_Manager::MEDIA, |
| 3156 | 'classes' => $this->pro_class, |
| 3157 | 'dynamic' => [ |
| 3158 | 'active' => false, |
| 3159 | ], |
| 3160 | 'condition' => [ |
| 3161 | 'instafeedProfileImage' => 'yes', |
| 3162 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3163 | ], |
| 3164 | 'ai' => $disableAi |
| 3165 | ] |
| 3166 | ); |
| 3167 | |
| 3168 | |
| 3169 | $this->add_control( |
| 3170 | 'instafeedFollowBtn', |
| 3171 | [ |
| 3172 | 'label' => __('Follow Button', 'embedpress'), |
| 3173 | 'type' => Controls_Manager::SWITCHER, |
| 3174 | 'label_block' => false, |
| 3175 | 'return_value' => 'yes', |
| 3176 | 'default' => 'yes', |
| 3177 | 'condition' => $condition, |
| 3178 | ] |
| 3179 | ); |
| 3180 | |
| 3181 | $this->add_control( |
| 3182 | 'instafeedFollowBtnLabel', |
| 3183 | [ |
| 3184 | 'label' => sprintf(__('Button Label %s', 'embedpress'), $this->pro_text), |
| 3185 | 'type' => Controls_Manager::TEXT, |
| 3186 | 'classes' => $this->pro_class, |
| 3187 | 'placeholder' => __('Follow', 'embedpress'), |
| 3188 | 'default' => 'Follow', |
| 3189 | 'separator' => 'after', |
| 3190 | 'label_block' => false, |
| 3191 | 'condition' => [ |
| 3192 | 'instafeedFollowBtn' => 'yes', |
| 3193 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3194 | ], |
| 3195 | 'ai' => $disableAi |
| 3196 | ] |
| 3197 | ); |
| 3198 | |
| 3199 | $this->add_control( |
| 3200 | 'instafeedPostsCount', |
| 3201 | [ |
| 3202 | 'label' => __('Posts Count', 'embedpress'), |
| 3203 | 'type' => Controls_Manager::SWITCHER, |
| 3204 | 'label_block' => false, |
| 3205 | 'return_value' => 'yes', |
| 3206 | 'default' => 'yes', |
| 3207 | 'condition' => [ |
| 3208 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 3209 | 'instafeedFeedType!' => 'hashtag_type' |
| 3210 | ], |
| 3211 | ] |
| 3212 | ); |
| 3213 | $this->add_control( |
| 3214 | 'instafeedPostsCountText', |
| 3215 | [ |
| 3216 | 'label' => __('Count Text', 'embedpress'), |
| 3217 | 'type' => Controls_Manager::TEXT, |
| 3218 | 'placeholder' => __('[count] posts', 'embedpress'), |
| 3219 | 'default' => '[count] posts', |
| 3220 | 'label_block' => false, |
| 3221 | 'separator' => 'after', |
| 3222 | 'condition' => [ |
| 3223 | 'instafeedPostsCount' => 'yes', |
| 3224 | 'instafeedFeedType!' => 'hashtag_type', |
| 3225 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 3226 | ], |
| 3227 | 'ai' => $disableAi |
| 3228 | ] |
| 3229 | ); |
| 3230 | $this->add_control( |
| 3231 | 'instafeedFollowersCount', |
| 3232 | [ |
| 3233 | 'label' => __('Followers Count', 'embedpress'), |
| 3234 | 'type' => Controls_Manager::SWITCHER, |
| 3235 | 'label_block' => false, |
| 3236 | 'return_value' => 'yes', |
| 3237 | 'default' => 'yes', |
| 3238 | 'condition' => [ |
| 3239 | 'instafeedAccountType!' => 'personal', |
| 3240 | 'instafeedFeedType!' => 'hashtag_type', |
| 3241 | 'embedpress_pro_embeded_source' => 'instafeed', |
| 3242 | ], |
| 3243 | ] |
| 3244 | ); |
| 3245 | $this->add_control( |
| 3246 | 'instafeedFollowersCountText', |
| 3247 | [ |
| 3248 | 'label' => __('Count Text', 'embedpress'), |
| 3249 | 'type' => Controls_Manager::TEXT, |
| 3250 | 'placeholder' => __('[count] followers', 'embedpress'), |
| 3251 | 'default' => '[count] followers', |
| 3252 | 'label_block' => false, |
| 3253 | 'separator' => 'after', |
| 3254 | 'condition' => [ |
| 3255 | 'instafeedAccountType!' => 'personal', |
| 3256 | 'instafeedFollowersCount' => 'yes', |
| 3257 | 'instafeedFeedType!' => 'hashtag_type', |
| 3258 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3259 | ], |
| 3260 | 'ai' => $disableAi |
| 3261 | ] |
| 3262 | ); |
| 3263 | |
| 3264 | $this->add_control( |
| 3265 | 'instafeedAccName', |
| 3266 | [ |
| 3267 | 'label' => __('Account Name', 'embedpress'), |
| 3268 | 'type' => Controls_Manager::SWITCHER, |
| 3269 | 'label_block' => false, |
| 3270 | 'return_value' => 'yes', |
| 3271 | 'default' => 'yes', |
| 3272 | 'condition' => [ |
| 3273 | 'instafeedAccountType!' => 'personal', |
| 3274 | 'instafeedFeedType!' => 'hashtag_type', |
| 3275 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3276 | ], |
| 3277 | ] |
| 3278 | ); |
| 3279 | $this->end_controls_section(); |
| 3280 | |
| 3281 | $this->start_controls_section( |
| 3282 | 'embedpress_instafeed_control_section', |
| 3283 | [ |
| 3284 | 'label' => __('Instagram Feed Settings', 'embedpress'), |
| 3285 | 'condition' => [ |
| 3286 | 'embedpress_pro_embeded_source' => 'instafeed' |
| 3287 | ], |
| 3288 | ] |
| 3289 | ); |
| 3290 | |
| 3291 | $this->init_instafeed_control(); |
| 3292 | |
| 3293 | $this->end_controls_section(); |
| 3294 | |
| 3295 | |
| 3296 | |
| 3297 | } |
| 3298 | |
| 3299 | |
| 3300 | //End Feed Controls |
| 3301 | |
| 3302 | |
| 3303 | /** |
| 3304 | * Calendly Controls |
| 3305 | */ |
| 3306 | public function init_calendly_control_section() |
| 3307 | { |
| 3308 | |
| 3309 | $condition = [ |
| 3310 | 'embedpress_pro_embeded_source' => 'calendly', |
| 3311 | ]; |
| 3312 | |
| 3313 | $this->start_controls_section( |
| 3314 | 'embedpress_calendly_control_section', |
| 3315 | [ |
| 3316 | 'label' => __('Calendly Controls', 'embedpress'), |
| 3317 | 'condition' => $condition, |
| 3318 | ] |
| 3319 | ); |
| 3320 | $this->add_control( |
| 3321 | 'cEmbedType', |
| 3322 | [ |
| 3323 | 'label' => __('Embed Type', 'embedpress'), |
| 3324 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 3325 | 'default' => 'inline', |
| 3326 | 'options' => [ |
| 3327 | 'inline' => __('Inline', 'embedpress'), |
| 3328 | 'popup_button' => __('Popup Button', 'embedpress'), |
| 3329 | ], |
| 3330 | 'condition' => $condition |
| 3331 | ] |
| 3332 | ); |
| 3333 | $this->add_control( |
| 3334 | 'popupControlsHeadding', |
| 3335 | [ |
| 3336 | 'label' => esc_html__('Popup Button Settings', 'embedpress'), |
| 3337 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 3338 | 'separator' => 'before', |
| 3339 | 'condition' => [ |
| 3340 | 'embedpress_pro_embeded_source' => 'calendly', |
| 3341 | 'cEmbedType' => 'popup_button' |
| 3342 | ] |
| 3343 | ] |
| 3344 | ); |
| 3345 | $this->add_control( |
| 3346 | 'cPopupButtonText', |
| 3347 | [ |
| 3348 | 'label' => __('Button Text', 'embedpress'), |
| 3349 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 3350 | 'label_block' => true, |
| 3351 | 'default' => 'Schedule time with me', |
| 3352 | 'condition' => [ |
| 3353 | 'embedpress_pro_embeded_source' => 'calendly', |
| 3354 | 'cEmbedType' => 'popup_button' |
| 3355 | ], |
| 3356 | 'ai' => [ |
| 3357 | 'active' => false, |
| 3358 | ], |
| 3359 | ] |
| 3360 | ); |
| 3361 | |
| 3362 | |
| 3363 | $this->add_control( |
| 3364 | 'cPopupButtonTextColor', |
| 3365 | [ |
| 3366 | 'label' => __('Text Color', 'embedpress'), |
| 3367 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 3368 | 'default' => '#ffffff', |
| 3369 | 'condition' => [ |
| 3370 | 'embedpress_pro_embeded_source' => 'calendly', |
| 3371 | 'cEmbedType' => 'popup_button' |
| 3372 | ] |
| 3373 | ] |
| 3374 | ); |
| 3375 | $this->add_control( |
| 3376 | 'cPopupButtonBGColor', |
| 3377 | [ |
| 3378 | 'label' => __('Background Color', 'embedpress'), |
| 3379 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 3380 | 'default' => '#0000FF', |
| 3381 | 'condition' => [ |
| 3382 | 'embedpress_pro_embeded_source' => 'calendly', |
| 3383 | 'cEmbedType' => 'popup_button' |
| 3384 | ] |
| 3385 | ] |
| 3386 | ); |
| 3387 | |
| 3388 | $this->add_control( |
| 3389 | 'calendlyControlsHeadding', |
| 3390 | [ |
| 3391 | 'label' => esc_html__('Calender Settings', 'embedpress'), |
| 3392 | 'type' => \Elementor\Controls_Manager::HEADING, |
| 3393 | 'separator' => 'before', |
| 3394 | ] |
| 3395 | ); |
| 3396 | |
| 3397 | $this->add_control( |
| 3398 | 'calendlyData', |
| 3399 | [ |
| 3400 | 'label' => sprintf(__('Calendly Data %s', 'embedpress'), $this->pro_text), |
| 3401 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3402 | 'default' => '', |
| 3403 | 'classes' => $this->pro_class, |
| 3404 | 'condition' => $condition |
| 3405 | ] |
| 3406 | ); |
| 3407 | |
| 3408 | $this->add_control( |
| 3409 | 'calendlyDataLink', |
| 3410 | [ |
| 3411 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 3412 | 'raw' => '<div style="display: flex; align-items: center;gap:5px;"><span style="font-size:18px" class="eicon-editor-external-link"></span><a href="/wp-admin/admin.php?page=embedpress&page_type=calendly" target="_blank" >View Calendly Data</a></div>', |
| 3413 | 'condition' => [ |
| 3414 | 'calendlyData' => 'yes' |
| 3415 | ] |
| 3416 | |
| 3417 | ] |
| 3418 | ); |
| 3419 | |
| 3420 | $this->add_control( |
| 3421 | 'hideCookieBanner', |
| 3422 | [ |
| 3423 | 'label' => __('Hide Cookie Banner', 'embedpress'), |
| 3424 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3425 | 'default' => '', |
| 3426 | 'condition' => $condition |
| 3427 | ] |
| 3428 | ); |
| 3429 | $this->add_control( |
| 3430 | 'hideEventTypeDetails', |
| 3431 | [ |
| 3432 | 'label' => __('Hide Event Type Details', 'embedpress'), |
| 3433 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3434 | 'default' => '', |
| 3435 | 'condition' => $condition |
| 3436 | ] |
| 3437 | ); |
| 3438 | |
| 3439 | $this->add_control( |
| 3440 | 'cBackgroundColor', |
| 3441 | [ |
| 3442 | 'label' => __('Background Color', 'embedpress'), |
| 3443 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 3444 | 'default' => '', |
| 3445 | 'condition' => $condition |
| 3446 | ] |
| 3447 | ); |
| 3448 | |
| 3449 | $this->add_control( |
| 3450 | 'cTextColor', |
| 3451 | [ |
| 3452 | 'label' => __('Text Color', 'embedpress'), |
| 3453 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 3454 | 'default' => '', |
| 3455 | 'condition' => $condition |
| 3456 | ] |
| 3457 | ); |
| 3458 | |
| 3459 | $this->add_control( |
| 3460 | 'cButtonLinkColor', |
| 3461 | [ |
| 3462 | 'label' => __('Button & Link Color', 'embedpress'), |
| 3463 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 3464 | 'default' => '', |
| 3465 | 'condition' => $condition |
| 3466 | ] |
| 3467 | ); |
| 3468 | |
| 3469 | $this->end_controls_section(); |
| 3470 | } |
| 3471 | |
| 3472 | //End calendly controlS |
| 3473 | |
| 3474 | /** |
| 3475 | * Start Spreaker Controls |
| 3476 | */ |
| 3477 | public function init_spreaker_control_section() |
| 3478 | { |
| 3479 | |
| 3480 | $condition = [ |
| 3481 | 'embedpress_pro_embeded_source' => 'spreaker', |
| 3482 | ]; |
| 3483 | |
| 3484 | $this->start_controls_section( |
| 3485 | 'embedpress_spreaker_control_section', |
| 3486 | [ |
| 3487 | 'label' => __('Spreaker Controls', 'embedpress'), |
| 3488 | 'condition' => $condition, |
| 3489 | ] |
| 3490 | ); |
| 3491 | |
| 3492 | $this->add_control( |
| 3493 | 'theme', |
| 3494 | [ |
| 3495 | 'label' => __('Theme', 'embedpress'), |
| 3496 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 3497 | 'default' => 'light', |
| 3498 | 'options' => [ |
| 3499 | 'light' => __('Light', 'embedpress'), |
| 3500 | 'dark' => __('Dark', 'embedpress'), |
| 3501 | ], |
| 3502 | ] |
| 3503 | ); |
| 3504 | |
| 3505 | $this->add_control( |
| 3506 | 'color', |
| 3507 | [ |
| 3508 | 'label' => __('Main Color', 'embedpress'), |
| 3509 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 3510 | ] |
| 3511 | ); |
| 3512 | |
| 3513 | $this->add_control( |
| 3514 | "coverImageUrl", |
| 3515 | [ |
| 3516 | 'label' => sprintf(__('Cover Image %s', 'embedpress'), $this->pro_text), |
| 3517 | 'type' => Controls_Manager::MEDIA, |
| 3518 | 'dynamic' => [ |
| 3519 | 'active' => true, |
| 3520 | ], |
| 3521 | 'classes' => $this->pro_class, |
| 3522 | |
| 3523 | ] |
| 3524 | ); |
| 3525 | |
| 3526 | |
| 3527 | |
| 3528 | $this->add_control( |
| 3529 | 'hideDownload', |
| 3530 | [ |
| 3531 | 'label' => sprintf(__('Disable Download %s', 'embedpress'), $this->pro_text), |
| 3532 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3533 | 'label_on' => __('Yes', 'embedpress'), |
| 3534 | 'label_off' => __('No', 'embedpress'), |
| 3535 | 'return_value' => 'yes', |
| 3536 | 'default' => 'no', |
| 3537 | 'classes' => $this->pro_class, |
| 3538 | ] |
| 3539 | ); |
| 3540 | |
| 3541 | $this->add_control( |
| 3542 | 'playlist', |
| 3543 | [ |
| 3544 | 'label' => __('Enable Playlist', 'embedpress'), |
| 3545 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3546 | 'label_on' => __('Yes', 'embedpress'), |
| 3547 | 'label_off' => __('No', 'embedpress'), |
| 3548 | 'return_value' => 'yes', |
| 3549 | 'default' => 'yes', |
| 3550 | 'description' => __('This option is for podcast playlists and doesn’t affect individual episodes.', 'embedpress'), |
| 3551 | ] |
| 3552 | ); |
| 3553 | |
| 3554 | |
| 3555 | $this->add_control( |
| 3556 | 'playlistContinuous', |
| 3557 | [ |
| 3558 | 'label' => sprintf(__('Continuous Playlist %s', 'embedpress'), $this->pro_text), |
| 3559 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3560 | 'label_on' => __('Yes', 'embedpress'), |
| 3561 | 'label_off' => __('No', 'embedpress'), |
| 3562 | 'return_value' => 'yes', |
| 3563 | 'default' => 'no', |
| 3564 | 'classes' => $this->pro_class, |
| 3565 | 'condition' => [ |
| 3566 | 'playlist' => 'yes', |
| 3567 | ], |
| 3568 | ] |
| 3569 | ); |
| 3570 | |
| 3571 | $this->add_control( |
| 3572 | 'playlistLoop', |
| 3573 | [ |
| 3574 | 'label' => __('Loop Playlist', 'embedpress'), |
| 3575 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3576 | 'label_on' => __('Yes', 'embedpress'), |
| 3577 | 'label_off' => __('No', 'embedpress'), |
| 3578 | 'return_value' => 'yes', |
| 3579 | 'default' => 'yes', |
| 3580 | 'condition' => [ |
| 3581 | 'playlist' => 'yes', |
| 3582 | 'playlistContinuous' => 'yes', |
| 3583 | ], |
| 3584 | ] |
| 3585 | ); |
| 3586 | |
| 3587 | $this->add_control( |
| 3588 | 'playlistAutoupdate', |
| 3589 | [ |
| 3590 | 'label' => __('Playlist Autoupdate', 'embedpress'), |
| 3591 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3592 | 'label_on' => __('Yes', 'embedpress'), |
| 3593 | 'label_off' => __('No', 'embedpress'), |
| 3594 | 'return_value' => 'yes', |
| 3595 | 'default' => 'yes', |
| 3596 | 'condition' => [ |
| 3597 | 'playlist' => 'yes', |
| 3598 | ], |
| 3599 | ] |
| 3600 | ); |
| 3601 | $this->add_control( |
| 3602 | 'hidePlaylistDescriptions', |
| 3603 | [ |
| 3604 | 'label' => __('Hide Playlist Descriptions', 'embedpress'), |
| 3605 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3606 | 'label_on' => __('Yes', 'embedpress'), |
| 3607 | 'label_off' => __('No', 'embedpress'), |
| 3608 | 'return_value' => 'yes', |
| 3609 | 'default' => 'no', |
| 3610 | 'condition' => [ |
| 3611 | 'playlist' => 'yes', |
| 3612 | ], |
| 3613 | ] |
| 3614 | ); |
| 3615 | |
| 3616 | $this->add_control( |
| 3617 | 'hidePlaylistImages', |
| 3618 | [ |
| 3619 | 'label' => __('Hide Playlist Images', 'embedpress'), |
| 3620 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3621 | 'label_on' => __('Yes', 'embedpress'), |
| 3622 | 'label_off' => __('No', 'embedpress'), |
| 3623 | 'return_value' => 'yes', |
| 3624 | 'default' => 'no', |
| 3625 | 'condition' => [ |
| 3626 | 'playlist' => 'yes', |
| 3627 | ], |
| 3628 | ] |
| 3629 | ); |
| 3630 | |
| 3631 | $this->add_control( |
| 3632 | 'episodeImagePosition', |
| 3633 | [ |
| 3634 | 'label' => __('Episode Image Position', 'embedpress'), |
| 3635 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 3636 | 'default' => 'right', |
| 3637 | 'options' => [ |
| 3638 | 'right' => __('Right', 'embedpress'), |
| 3639 | 'left' => __('Left', 'embedpress'), |
| 3640 | ], |
| 3641 | 'label_block' => true, |
| 3642 | ] |
| 3643 | ); |
| 3644 | |
| 3645 | |
| 3646 | $this->add_control( |
| 3647 | 'showChaptersImage', |
| 3648 | [ |
| 3649 | 'label' => __('Show Chapters Images', 'embedpress'), |
| 3650 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3651 | 'label_on' => __('Yes', 'embedpress'), |
| 3652 | 'label_off' => __('No', 'embedpress'), |
| 3653 | 'return_value' => 'yes', |
| 3654 | 'default' => 'yes', |
| 3655 | 'description' => __('Only applies if the podcast includes chapter images.', 'embedpress'), |
| 3656 | ] |
| 3657 | ); |
| 3658 | |
| 3659 | $this->add_control( |
| 3660 | 'hideLikes', |
| 3661 | [ |
| 3662 | 'label' => __('Hide Likes', 'embedpress'), |
| 3663 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3664 | 'label_on' => __('Yes', 'embedpress'), |
| 3665 | 'label_off' => __('No', 'embedpress'), |
| 3666 | 'return_value' => 'yes', |
| 3667 | 'default' => 'no', |
| 3668 | ] |
| 3669 | ); |
| 3670 | |
| 3671 | $this->add_control( |
| 3672 | 'hideComments', |
| 3673 | [ |
| 3674 | 'label' => __('Hide Comments', 'embedpress'), |
| 3675 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3676 | 'label_on' => __('Yes', 'embedpress'), |
| 3677 | 'label_off' => __('No', 'embedpress'), |
| 3678 | 'return_value' => 'yes', |
| 3679 | 'default' => 'no', |
| 3680 | ] |
| 3681 | ); |
| 3682 | |
| 3683 | $this->add_control( |
| 3684 | 'hideSharing', |
| 3685 | [ |
| 3686 | 'label' => __('Hide Sharing', 'embedpress'), |
| 3687 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3688 | 'label_on' => __('Yes', 'embedpress'), |
| 3689 | 'label_off' => __('No', 'embedpress'), |
| 3690 | 'return_value' => 'yes', |
| 3691 | 'default' => 'no', |
| 3692 | ] |
| 3693 | ); |
| 3694 | |
| 3695 | $this->add_control( |
| 3696 | 'hideLogo', |
| 3697 | [ |
| 3698 | 'label' => __('Hide Logo', 'embedpress'), |
| 3699 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3700 | 'label_on' => __('Yes', 'embedpress'), |
| 3701 | 'label_off' => __('No', 'embedpress'), |
| 3702 | 'return_value' => 'yes', |
| 3703 | 'default' => 'no', |
| 3704 | 'description' => __('Hide the Spreaker logo and branding in the player. Requires Broadcaster plan or higher.', 'embedpress'), |
| 3705 | ] |
| 3706 | ); |
| 3707 | |
| 3708 | $this->add_control( |
| 3709 | 'hideEpisodeDescription', |
| 3710 | [ |
| 3711 | 'label' => __('Hide Episode Description', 'embedpress'), |
| 3712 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 3713 | 'label_on' => __('Yes', 'embedpress'), |
| 3714 | 'label_off' => __('No', 'embedpress'), |
| 3715 | 'return_value' => 'yes', |
| 3716 | 'default' => 'no', |
| 3717 | ] |
| 3718 | ); |
| 3719 | |
| 3720 | |
| 3721 | $this->end_controls_section(); |
| 3722 | } |
| 3723 | |
| 3724 | /** |
| 3725 | * End Spreaker Controls |
| 3726 | */ |
| 3727 | |
| 3728 | |
| 3729 | public function init_style_controls() |
| 3730 | { |
| 3731 | $this->start_controls_section( |
| 3732 | 'embedpress_style_section', |
| 3733 | [ |
| 3734 | 'label' => __('General', 'embedpress'), |
| 3735 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3736 | 'condition' => [ |
| 3737 | 'embedpress_pro_embeded_source!' => 'opensea', |
| 3738 | ] |
| 3739 | |
| 3740 | ] |
| 3741 | ); |
| 3742 | $this->add_responsive_control( |
| 3743 | 'width', |
| 3744 | [ |
| 3745 | 'label' => __('Width', 'embedpress'), |
| 3746 | 'type' => Controls_Manager::SLIDER, |
| 3747 | 'size_units' => ['px'], |
| 3748 | 'range' => [ |
| 3749 | 'px' => [ |
| 3750 | 'min' => 0, |
| 3751 | 'max' => 1500, |
| 3752 | 'step' => 1, |
| 3753 | ], |
| 3754 | ], |
| 3755 | 'devices' => ['desktop', 'tablet', 'mobile'], |
| 3756 | 'default' => [ |
| 3757 | 'size' => !empty($value = intval(Helper::get_options_value('enableEmbedResizeWidth'))) ? $value : 600, |
| 3758 | 'unit' => 'px', |
| 3759 | ], |
| 3760 | 'desktop_default' => [ |
| 3761 | 'size' => 600, |
| 3762 | 'unit' => 'px', |
| 3763 | ], |
| 3764 | 'tablet_default' => [ |
| 3765 | 'size' => 600, |
| 3766 | 'unit' => 'px', |
| 3767 | ], |
| 3768 | 'mobile_default' => [ |
| 3769 | 'size' => 600, |
| 3770 | 'unit' => 'px', |
| 3771 | ], |
| 3772 | 'selectors' => [ |
| 3773 | '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive>iframe,{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive, {{WRAPPER}} .sponsored-youtube-video > iframe, |
| 3774 | {{WRAPPER}} .plyr--video, {{WRAPPER}} .ose-giphy img' => 'width: {{size}}{{UNIT}}!important; max-width: 100%!important;', |
| 3775 | ], |
| 3776 | ] |
| 3777 | ); |
| 3778 | |
| 3779 | $this->add_responsive_control( |
| 3780 | 'height', |
| 3781 | [ |
| 3782 | 'label' => __('Height', 'embedpress'), |
| 3783 | 'type' => Controls_Manager::SLIDER, |
| 3784 | 'size_units' => ['px', '%'], |
| 3785 | 'range' => [ |
| 3786 | 'px' => [ |
| 3787 | 'min' => 0, |
| 3788 | 'max' => 1500, |
| 3789 | 'step' => 1, |
| 3790 | ], |
| 3791 | ], |
| 3792 | 'devices' => ['desktop', 'tablet', 'mobile'], |
| 3793 | 'desktop_default' => [ |
| 3794 | 'size' => 400, |
| 3795 | 'unit' => 'px', |
| 3796 | ], |
| 3797 | 'default' => [ |
| 3798 | 'size' => !empty($value = intval(Helper::get_options_value('enableEmbedResizeHeight'))) ? $value : 600, |
| 3799 | 'unit' => 'px', |
| 3800 | ], |
| 3801 | 'tablet_default' => [ |
| 3802 | 'size' => 400, |
| 3803 | 'unit' => 'px', |
| 3804 | ], |
| 3805 | 'mobile_default' => [ |
| 3806 | 'size' => 400, |
| 3807 | 'unit' => 'px', |
| 3808 | ], |
| 3809 | 'selectors' => [ |
| 3810 | '{{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive iframe, {{WRAPPER}} .embedpress-elements-wrapper .ose-embedpress-responsive,{{WRAPPER}} .sponsored-youtube-video > iframe, |
| 3811 | {{WRAPPER}} .plyr--video, {{WRAPPER}} .ose-giphy img' => 'height: {{size}}{{UNIT}}!important;max-height: 100%!important', |
| 3812 | ], |
| 3813 | 'condition' => [ |
| 3814 | 'embedpress_pro_embeded_source!' => 'instafeed' |
| 3815 | ], |
| 3816 | ] |
| 3817 | ); |
| 3818 | $this->add_control( |
| 3819 | 'width_height_important_note', |
| 3820 | [ |
| 3821 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 3822 | 'raw' => esc_html__('Note: The maximum width and height are set to 100%.', 'embedpress'), |
| 3823 | 'content_classes' => 'elementor-panel-alert elementor-panel-warning-info', |
| 3824 | ] |
| 3825 | ); |
| 3826 | $this->add_responsive_control( |
| 3827 | 'margin', |
| 3828 | [ |
| 3829 | 'label' => __('Margin', 'embedpress'), |
| 3830 | 'type' => Controls_Manager::DIMENSIONS, |
| 3831 | 'size_units' => ['px', '%', 'em'], |
| 3832 | 'selectors' => [ |
| 3833 | '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3834 | ], |
| 3835 | ] |
| 3836 | ); |
| 3837 | $this->add_responsive_control( |
| 3838 | 'padding', |
| 3839 | [ |
| 3840 | 'label' => __('Padding', 'embedpress'), |
| 3841 | 'type' => Controls_Manager::DIMENSIONS, |
| 3842 | 'size_units' => ['px', '%', 'em'], |
| 3843 | 'selectors' => [ |
| 3844 | '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3845 | ], |
| 3846 | ] |
| 3847 | ); |
| 3848 | $this->add_responsive_control( |
| 3849 | 'align', |
| 3850 | [ |
| 3851 | 'label' => esc_html__('Alignment', 'embedpress'), |
| 3852 | 'type' => Controls_Manager::CHOOSE, |
| 3853 | 'options' => [ |
| 3854 | 'left' => [ |
| 3855 | 'title' => esc_html__('Left', 'embedpress'), |
| 3856 | 'icon' => 'eicon-text-align-left', |
| 3857 | ], |
| 3858 | 'center' => [ |
| 3859 | 'title' => esc_html__('Center', 'embedpress'), |
| 3860 | 'icon' => 'eicon-text-align-center', |
| 3861 | ], |
| 3862 | 'right' => [ |
| 3863 | 'title' => esc_html__('Right', 'embedpress'), |
| 3864 | 'icon' => 'eicon-text-align-right', |
| 3865 | ], |
| 3866 | ], |
| 3867 | 'prefix_class' => 'elementor%s-align-', |
| 3868 | 'default' => '', |
| 3869 | ] |
| 3870 | ); |
| 3871 | $this->end_controls_section(); |
| 3872 | } |
| 3873 | |
| 3874 | public function render_plain_content() |
| 3875 | { |
| 3876 | $args = ""; |
| 3877 | $settings = $this->get_settings_for_display(); |
| 3878 | |
| 3879 | $_settings = $this->convert_settings($settings); |
| 3880 | foreach ($_settings as $key => $value) { |
| 3881 | $args .= "$key='" . esc_attr($value) . "' "; |
| 3882 | } |
| 3883 | |
| 3884 | $args = trim($args); |
| 3885 | $embed_code = sprintf("[embedpress %s]%s[/embedpress]", $args, esc_url($settings['embedpress_embeded_link'])); |
| 3886 | echo $embed_code; |
| 3887 | } |
| 3888 | |
| 3889 | |
| 3890 | public function get_custom_player_options($settings) |
| 3891 | { |
| 3892 | |
| 3893 | $_player_options = ''; |
| 3894 | |
| 3895 | if (!empty($settings['emberpress_custom_player'])) { |
| 3896 | |
| 3897 | $player_preset = !empty($settings['custom_payer_preset']) ? sanitize_text_field($settings['custom_payer_preset']) : 'preset-default'; |
| 3898 | |
| 3899 | $player_color = !empty($settings['embedpress_player_color']) ? sanitize_hex_color($settings['embedpress_player_color']) : ''; |
| 3900 | |
| 3901 | $poster_thumbnail = !empty($settings['embedpress_player_poster_thumbnail']['url']) ? esc_url($settings['embedpress_player_poster_thumbnail']['url']) : ''; |
| 3902 | |
| 3903 | |
| 3904 | $is_self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']); |
| 3905 | |
| 3906 | |
| 3907 | $player_pip = !empty($settings['embepress_player_always_on_top']) ? true : false; |
| 3908 | $player_restart = !empty($settings['embepress_player_restart']) ? true : false; |
| 3909 | $player_rewind = !empty($settings['embepress_player_rewind']) ? true : false; |
| 3910 | $player_fastForward = !empty($settings['embepress_player_fast_forward']) ? true : false; |
| 3911 | $player_tooltip = !empty($settings['embepress_player_tooltip']) ? true : false; |
| 3912 | $player_hide_controls = !empty($settings['embepress_player_hide_controls']) ? true : false; |
| 3913 | $player_download = !empty($settings['embepress_player_download']) ? true : false; |
| 3914 | $player_fullscreen = !empty($settings['embedpress_pro_youtube_enable_fullscreen_button']) ? true : false; |
| 3915 | |
| 3916 | $playerOptions = [ |
| 3917 | 'rewind' => $player_rewind, |
| 3918 | 'restart' => $player_restart, |
| 3919 | 'pip' => $player_pip, |
| 3920 | 'poster_thumbnail' => $poster_thumbnail, |
| 3921 | 'player_color' => $player_color, |
| 3922 | 'player_preset' => $player_preset, |
| 3923 | 'fast_forward' => $player_fastForward, |
| 3924 | 'player_tooltip' => $player_tooltip, |
| 3925 | 'hide_controls' => $player_hide_controls, |
| 3926 | 'download' => $player_download, |
| 3927 | 'fullscreen' => $player_fullscreen, |
| 3928 | ]; |
| 3929 | |
| 3930 | |
| 3931 | //Youtube options |
| 3932 | if (!empty($settings['embedpress_pro_video_start_time'])) { |
| 3933 | $playerOptions['start'] = $settings['embedpress_pro_video_start_time']; |
| 3934 | } |
| 3935 | if (!empty($settings['embedpress_pro_youtube_end_time'])) { |
| 3936 | $playerOptions['end'] = $settings['embedpress_pro_youtube_end_time']; |
| 3937 | } |
| 3938 | if (!empty($settings['embedpress_pro_youtube_display_related_videos'])) { |
| 3939 | $playerOptions['rel'] = true; |
| 3940 | } else { |
| 3941 | $playerOptions['rel'] = false; |
| 3942 | } |
| 3943 | |
| 3944 | //vimeo options |
| 3945 | if (!empty($settings['embedpress_pro_video_start_time'])) { |
| 3946 | $playerOptions['t'] = $settings['embedpress_pro_video_start_time']; |
| 3947 | } |
| 3948 | if (!empty($settings['embedpress_pro_vimeo_auto_play'])) { |
| 3949 | $playerOptions['vautoplay'] = true; |
| 3950 | } else { |
| 3951 | $playerOptions['vautoplay'] = false; |
| 3952 | } |
| 3953 | if (!empty($settings['embedpress_pro_vimeo_autopause'])) { |
| 3954 | $playerOptions['autopause'] = true; |
| 3955 | } else { |
| 3956 | $playerOptions['autopause'] = false; |
| 3957 | } |
| 3958 | |
| 3959 | if (!empty($settings['embedpress_pro_vimeo_dnt'])) { |
| 3960 | $playerOptions['dnt'] = true; |
| 3961 | } else { |
| 3962 | $playerOptions['dnt'] = false; |
| 3963 | } |
| 3964 | |
| 3965 | if (!empty($is_self_hosted['selhosted'])) { |
| 3966 | $playerOptions['self_hosted'] = $is_self_hosted['selhosted']; |
| 3967 | $playerOptions['hosted_format'] = $is_self_hosted['format']; |
| 3968 | } |
| 3969 | |
| 3970 | $playerOptionsString = json_encode($playerOptions); |
| 3971 | $_player_options = 'data-options=' . htmlentities($playerOptionsString, ENT_QUOTES); |
| 3972 | |
| 3973 | } |
| 3974 | |
| 3975 | return $_player_options; |
| 3976 | } |
| 3977 | |
| 3978 | public function get_instafeed_carousel_options($settings) |
| 3979 | { |
| 3980 | $_carousel_options = ''; |
| 3981 | |
| 3982 | if(!empty($settings['instaLayout']) && $settings['instaLayout'] === 'insta-carousel'){ |
| 3983 | $_carousel_id = 'data-carouselid=' . esc_attr($this->get_id()) . ''; |
| 3984 | |
| 3985 | $layout = $settings['instaLayout']; |
| 3986 | $embedpress_instafeed_slide_show = !empty($settings['embedpress_instafeed_slide_show']) ? $settings['embedpress_instafeed_slide_show'] : 5; |
| 3987 | $embedpress_carousel_autoplay = !empty($settings['embedpress_carousel_autoplay']) ? $settings['embedpress_carousel_autoplay'] : 0; |
| 3988 | $embedpress_carousel_autoplay_speed = !empty($settings['embedpress_carousel_autoplay_speed']) ? $settings['embedpress_carousel_autoplay_speed'] : 3000; |
| 3989 | $embedpress_carousel_transition_speed = !empty($settings['embedpress_carousel_transition_speed']) ? $settings['embedpress_carousel_transition_speed'] : 1000; |
| 3990 | $embedpress_carousel_loop = !empty($settings['embedpress_carousel_loop']) ? $settings['embedpress_carousel_loop'] : 0; |
| 3991 | $embedpress_carousel_arrows = !empty($settings['embedpress_carousel_arrows']) ? $settings['embedpress_carousel_arrows'] : 0; |
| 3992 | $spacing = !empty($settings['embedpress_carousel_spacing']) ? $settings['embedpress_carousel_spacing'] : 0; |
| 3993 | |
| 3994 | // print_r($settings); |
| 3995 | |
| 3996 | $carousel_options = [ |
| 3997 | 'layout' => $layout, |
| 3998 | 'slideshow' => $embedpress_instafeed_slide_show, |
| 3999 | 'autoplay' => $embedpress_carousel_autoplay, |
| 4000 | 'autoplayspeed' => $embedpress_carousel_autoplay_speed, |
| 4001 | 'transitionspeed' => $embedpress_carousel_transition_speed, |
| 4002 | 'loop' => $embedpress_carousel_loop, |
| 4003 | 'arrows' => $embedpress_carousel_arrows, |
| 4004 | 'spacing' => $spacing |
| 4005 | ]; |
| 4006 | |
| 4007 | $carousel_options_string = json_encode($carousel_options); |
| 4008 | $_carousel_options = 'data-carousel-options='. htmlentities($carousel_options_string, ENT_QUOTES) .''; |
| 4009 | } |
| 4010 | return $_carousel_options; |
| 4011 | } |
| 4012 | |
| 4013 | public function get_instafeed_layout($settings){ |
| 4014 | $insta_layout = ''; |
| 4015 | if($settings['embedpress_pro_embeded_source'] == 'instafeed'){ |
| 4016 | $insta_layout = ' '. $settings['instaLayout']; |
| 4017 | } |
| 4018 | |
| 4019 | return $insta_layout; |
| 4020 | } |
| 4021 | |
| 4022 | protected function convert_settings($settings) |
| 4023 | { |
| 4024 | $_settings = []; |
| 4025 | foreach ($settings as $key => $value) { |
| 4026 | if (empty($value)) { |
| 4027 | $_settings[$key] = 'false'; |
| 4028 | } else if (!empty($value['size'])) { |
| 4029 | $_settings[$key] = $value['size']; |
| 4030 | } else if (!empty($value['url'])) { |
| 4031 | $_settings[$key] = $value['url']; |
| 4032 | } else if (\is_scalar($value)) { |
| 4033 | $_settings[$key] = $value; |
| 4034 | } |
| 4035 | } |
| 4036 | |
| 4037 | return $_settings; |
| 4038 | } |
| 4039 | |
| 4040 | public function validUserAccountUrl($url){ |
| 4041 | $pattern = '/^(?:https?:\/\/)?(?:www\.)?instagram\.com\/(?:[a-zA-Z0-9_\.]+\/?)$/'; |
| 4042 | return (bool) preg_match($pattern, $url); |
| 4043 | } |
| 4044 | |
| 4045 | function validInstagramTagUrl($url) { |
| 4046 | $pattern = '/^(?:https?:\/\/)?(?:www\.)?instagram\.com\/explore\/tags\/[a-zA-Z0-9_\-]+\/?$/'; |
| 4047 | return (bool) preg_match($pattern, $url); |
| 4048 | } |
| 4049 | |
| 4050 | protected function render() |
| 4051 | { |
| 4052 | $settings = $this->get_settings_for_display(); |
| 4053 | Helper::get_enable_settings_data_for_scripts($settings); |
| 4054 | |
| 4055 | add_filter('embedpress_should_modify_spotify', '__return_false'); |
| 4056 | $embed_link = isset($settings['embedpress_embeded_link']) ? $settings['embedpress_embeded_link'] : ''; |
| 4057 | |
| 4058 | |
| 4059 | if(!apply_filters('embedpress/is_allow_rander', false) && ($settings['instaLayout'] === 'insta-masonry' || $settings['instaLayout'] === 'insta-carousel' || $settings['instafeedFeedType'] === 'hashtag_type')){ |
| 4060 | echo '<div class="pro__alert__wrap" style="display: block;"> |
| 4061 | <div class="pro__alert__card"> |
| 4062 | <h2>Opps...</h2> |
| 4063 | <p>You need to upgrade to the <a style="font-weight: bold; color: #5B4E96; text-decoration: underline" href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Premium</a> Version to use this feature</p> |
| 4064 | </div> |
| 4065 | </div>'; |
| 4066 | return ''; |
| 4067 | } |
| 4068 | |
| 4069 | if(!apply_filters('embedpress/is_allow_rander', false) && ($settings['ytChannelLayout'] === 'carousel' || $settings['ytChannelLayout'] === 'grid')){ |
| 4070 | echo '<div class="pro__alert__wrap" style="display: block;"> |
| 4071 | <div class="pro__alert__card"> |
| 4072 | <h2>Opps...</h2> |
| 4073 | <p>You need to upgrade to the <a style="font-weight: bold; color: #5B4E96; text-decoration: underline" href="https://wpdeveloper.com/in/upgrade-embedpress" target="_blank">Premium</a> Version to use this feature</p> |
| 4074 | </div> |
| 4075 | </div>'; |
| 4076 | return ''; |
| 4077 | } |
| 4078 | |
| 4079 | if($settings['instafeedFeedType'] === 'mixed_type' || $settings['instafeedFeedType'] === 'tagged_type'){ |
| 4080 | echo 'Comming Soon.'; |
| 4081 | return ''; |
| 4082 | } |
| 4083 | |
| 4084 | if($settings['instafeedFeedType'] === 'hashtag_type' && !$this->validInstagramTagUrl($embed_link)){ |
| 4085 | echo 'Please add valid hashtag link url'; |
| 4086 | return ''; |
| 4087 | } |
| 4088 | |
| 4089 | if($settings['instafeedFeedType'] === 'user_account_type' && !$this->validUserAccountUrl($embed_link)){ |
| 4090 | echo 'Please add valid user account link url'; |
| 4091 | return ''; |
| 4092 | } |
| 4093 | |
| 4094 | $is_editor_view = Plugin::$instance->editor->is_edit_mode(); |
| 4095 | $link = $settings['embedpress_embeded_link']; |
| 4096 | $is_apple_podcast = (strpos($link, 'podcasts.apple.com') !== false); |
| 4097 | |
| 4098 | // conditionaly convert settings data |
| 4099 | $_settings = []; |
| 4100 | $source = isset($settings['embedpress_pro_embeded_source']) ? esc_attr($settings['embedpress_pro_embeded_source']) : 'default'; |
| 4101 | $embed_link = isset($settings['embedpress_embeded_link']) ? esc_url($settings['embedpress_embeded_link']) : ''; |
| 4102 | $pass_hash_key = isset($settings['embedpress_lock_content_password']) ? md5($settings['embedpress_lock_content_password']) : ''; |
| 4103 | |
| 4104 | |
| 4105 | |
| 4106 | Helper::get_source_data(md5($this->get_id()) . '_eb_elementor', esc_url($embed_link), 'elementor_source_data', 'elementor_temp_source_data'); |
| 4107 | |
| 4108 | if (!(($source === 'default' || !empty($source[0]) && $source[0] === 'default') && strpos($embed_link, 'opensea.io') !== false)) { |
| 4109 | $_settings = $this->convert_settings($settings); |
| 4110 | } |
| 4111 | |
| 4112 | if (strpos($embed_link, 'opensea.io') !== false) { |
| 4113 | $source = 'opensea'; |
| 4114 | } |
| 4115 | |
| 4116 | $_settings = Helper::removeQuote($_settings); |
| 4117 | |
| 4118 | |
| 4119 | $embed_content = Shortcode::parseContent($settings['embedpress_embeded_link'], true, $_settings); |
| 4120 | $embed_content = $this->onAfterEmbedSpotify($embed_content, $settings); |
| 4121 | $embed = apply_filters('embedpress_elementor_embed', $embed_content, $settings); |
| 4122 | $content = is_object($embed) ? $embed->embed : $embed; |
| 4123 | |
| 4124 | $embed_settings = []; |
| 4125 | $embed_settings['customThumbnail'] = !empty($settings['embedpress_content_share_custom_thumbnail']['url']) ? esc_url($settings['embedpress_content_share_custom_thumbnail']['url']) : ''; |
| 4126 | |
| 4127 | $embed_settings['customTitle'] = !empty($settings['embedpress_content_title']) ? sanitize_text_field($settings['embedpress_content_title']) : Helper::get_file_title($embed_link); |
| 4128 | |
| 4129 | $embed_settings['customDescription'] = !empty($settings['embedpress_content_descripiton']) ? sanitize_text_field($settings['embedpress_content_descripiton']) : Helper::get_file_title($embed_link); |
| 4130 | |
| 4131 | $embed_settings['sharePosition'] = !empty($settings['embedpress_content_share_position']) ? sanitize_text_field($settings['embedpress_content_share_position']) : 'right'; |
| 4132 | |
| 4133 | $embed_settings['lockHeading'] = !empty($settings['embedpress_lock_content_heading']) ? sanitize_text_field($settings['embedpress_lock_content_heading']) : ''; |
| 4134 | |
| 4135 | $embed_settings['lockSubHeading'] = !empty($settings['embedpress_lock_content_sub_heading']) ? sanitize_text_field($settings['embedpress_lock_content_sub_heading']) : ''; |
| 4136 | |
| 4137 | $embed_settings['passwordPlaceholder'] = !empty($settings['embedpress_password_placeholder']) ? sanitize_text_field($settings['embedpress_password_placeholder']) : ''; |
| 4138 | |
| 4139 | $embed_settings['submitButtonText'] = !empty($settings['embedpress_submit_button_text']) ? sanitize_text_field($settings['embedpress_submit_button_text']) : ''; |
| 4140 | |
| 4141 | $embed_settings['submitUnlockingText'] = !empty($settings['embedpress_submit_Unlocking_text']) ? sanitize_text_field($settings['embedpress_submit_Unlocking_text']) : ''; |
| 4142 | |
| 4143 | $embed_settings['lockErrorMessage'] = !empty($settings['embedpress_lock_content_error_message']) ? sanitize_text_field($settings['embedpress_lock_content_error_message']) : ''; |
| 4144 | |
| 4145 | $embed_settings['enableFooterMessage'] = !empty($settings['embedpress_enable_footer_message']) ? sanitize_text_field($settings['embedpress_enable_footer_message']) : ''; |
| 4146 | |
| 4147 | $embed_settings['footerMessage'] = !empty($settings['embedpress_lock_content_footer_message']) ? sanitize_text_field($settings['embedpress_lock_content_footer_message']) : ''; |
| 4148 | |
| 4149 | |
| 4150 | |
| 4151 | $client_id = $this->get_id(); |
| 4152 | $hash_pass = hash('sha256', wp_salt(32) . md5($settings['embedpress_lock_content_password'] ? sanitize_text_field($settings['embedpress_lock_content_password']) : '')); |
| 4153 | |
| 4154 | $password_correct = isset($_COOKIE['password_correct_' . $client_id]) ? sanitize_text_field($_COOKIE['password_correct_' . $client_id]) : ''; |
| 4155 | |
| 4156 | $ispagination = 'flex'; |
| 4157 | |
| 4158 | if ($settings['pagination'] != 'show') { |
| 4159 | $ispagination = 'none'; |
| 4160 | } |
| 4161 | |
| 4162 | |
| 4163 | $calVal = ''; |
| 4164 | |
| 4165 | if (!empty($settings['columns']) && is_numeric($settings['columns']) && (int) $settings['columns'] > 0) { |
| 4166 | $columns = (int) $settings['columns']; |
| 4167 | $gap_size = isset($settings['gapbetweenvideos']['size']) ? absint($settings['gapbetweenvideos']['size']) : 0; |
| 4168 | $calVal = 'calc(' . (100 / $columns) . '% - ' . $gap_size . 'px)'; |
| 4169 | } else { |
| 4170 | $calVal = 'auto'; |
| 4171 | } |
| 4172 | |
| 4173 | |
| 4174 | $content_share_class = ''; |
| 4175 | $share_position_class = ''; |
| 4176 | $share_position = isset($settings['embedpress_content_share_position']) ? esc_attr($settings['embedpress_content_share_position']) : 'right'; |
| 4177 | |
| 4178 | if (!empty($settings['embedpress_content_share'])) { |
| 4179 | $content_share_class = 'ep-content-share-enabled'; |
| 4180 | $share_position_class = 'ep-share-position-' . $share_position; |
| 4181 | } |
| 4182 | |
| 4183 | $content_protection_class = 'ep-content-protection-enabled'; |
| 4184 | if (empty($settings['embedpress_lock_content']) || empty($settings['embedpress_lock_content_password']) || $hash_pass === $password_correct) { |
| 4185 | $content_protection_class = 'ep-content-protection-disabled'; |
| 4186 | } |
| 4187 | |
| 4188 | $data_playerid = ''; |
| 4189 | if (!empty($settings['embedpress_custom_player'])) { |
| 4190 | $data_playerid = 'data-playerid="' . esc_attr($this->get_id()) . '"'; |
| 4191 | // $data_playerid = 'data-playerid='.esc_attr($this->get_id()); |
| 4192 | } |
| 4193 | |
| 4194 | $data_carouselid = ''; |
| 4195 | if (!empty($settings['instaLayout']) && $settings['instaLayout'] === 'insta-carousel') { |
| 4196 | $data_carouselid = 'data-carouselid="' . esc_attr($this->get_id()) . '"'; |
| 4197 | } |
| 4198 | |
| 4199 | $cEmbedType = !empty($settings['cEmbedType']) ? sanitize_text_field($settings['cEmbedType']) : ''; |
| 4200 | |
| 4201 | $adsAtts = ''; |
| 4202 | |
| 4203 | if (!empty($settings['adManager'])) { |
| 4204 | $ad = base64_encode(json_encode($settings)); // Using WordPress JSON encoding function |
| 4205 | $adsAtts = 'data-sponsored-id="' . esc_attr($client_id) . '" data-sponsored-attrs="' . esc_attr($ad) . '" class="sponsored-mask"'; |
| 4206 | } |
| 4207 | |
| 4208 | $data_player_id = ''; |
| 4209 | |
| 4210 | if (!empty($settings['emberpress_custom_player']) && $settings['emberpress_custom_player'] === 'yes') { |
| 4211 | $data_player_id = "data-playerid='" . esc_attr($this->get_id()) . "'"; |
| 4212 | } |
| 4213 | |
| 4214 | $hosted_format = ''; |
| 4215 | if (!empty($settings['emberpress_custom_player'])) { |
| 4216 | $self_hosted = Helper::check_media_format($settings['embedpress_embeded_link']); |
| 4217 | $hosted_format = isset($self_hosted['format']) ? $self_hosted['format'] : ''; |
| 4218 | } |
| 4219 | |
| 4220 | $autoPause = ''; |
| 4221 | if(!empty($settings['embedpress_audio_video_auto_pause'])){ |
| 4222 | $autoPause = ' enabled-auto-pause'; |
| 4223 | } |
| 4224 | |
| 4225 | ?> |
| 4226 | |
| 4227 | <div class="embedpress-elements-wrapper <?php echo !empty($settings['embedpress_elementor_aspect_ratio']) ? 'embedpress-fit-aspect-ratio' : ''; |
| 4228 | echo esc_attr($cEmbedType); ?>" id="ep-elements-id-<?php echo esc_attr($this->get_id()); ?>"> |
| 4229 | |
| 4230 | <?php if(!apply_filters('embedpress/is_allow_rander', false) && $is_editor_view && $is_apple_podcast) : ?> |
| 4231 | |
| 4232 | <p><?php esc_html_e('You need EmbedPress Pro to Embed Apple Podcast. Note. This message is only visible to you.', 'embedpress'); ?></p> |
| 4233 | <?php else: ?> |
| 4234 | <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>" |
| 4235 | class="ep-elementor-content |
| 4236 | <?php |
| 4237 | if (!empty($settings['embedpress_content_share'])) : |
| 4238 | echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper'); |
| 4239 | endif; |
| 4240 | ?> |
| 4241 | <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class); ?> |
| 4242 | <?php echo esc_attr('source-' . $source); ?> |
| 4243 | <?php echo esc_attr($autoPause); ?>"> |
| 4244 | |
| 4245 | <div id="<?php echo esc_attr($this->get_id()); ?>" |
| 4246 | class="ep-embed-content-wrapper |
| 4247 | <?php echo isset($settings['custom_player_preset']) ? esc_attr($settings['custom_player_preset']) : ''; ?> |
| 4248 | <?php echo esc_attr($this->get_instafeed_layout($settings)); ?> |
| 4249 | <?php echo esc_attr($hosted_format); ?>" |
| 4250 | <?php echo $data_playerid; ?> |
| 4251 | <?php echo $data_carouselid; ?> |
| 4252 | <?php echo $this->get_custom_player_options($settings); ?> |
| 4253 | <?php echo $this->get_instafeed_carousel_options($settings); ?>> |
| 4254 | |
| 4255 | <div id="ep-elementor-content-<?php echo esc_attr($client_id) ?>" |
| 4256 | class="ep-elementor-content |
| 4257 | <?php |
| 4258 | if (!empty($settings['embedpress_content_share'])) : |
| 4259 | echo esc_attr('position-' . $settings['embedpress_content_share_position'] . '-wraper'); |
| 4260 | endif; |
| 4261 | ?> |
| 4262 | <?php echo esc_attr($content_share_class . ' ' . $share_position_class . ' ' . $content_protection_class); ?> |
| 4263 | <?php echo esc_attr('source-' . $source); ?>"> |
| 4264 | |
| 4265 | <div <?php echo $adsAtts; ?>> |
| 4266 | <div id="<?php echo esc_attr($this->get_id()); ?>" |
| 4267 | class="ep-embed-content-wraper |
| 4268 | <?php echo esc_attr($settings['custom_payer_preset']); ?>" |
| 4269 | <?php echo $data_player_id; ?> |
| 4270 | <?php echo $this->get_custom_player_options($settings); ?>> |
| 4271 | |
| 4272 | <?php |
| 4273 | $content_id = $client_id; |
| 4274 | if ( |
| 4275 | (empty($settings['embedpress_lock_content']) || |
| 4276 | empty($settings['embedpress_lock_content_password']) || |
| 4277 | $settings['embedpress_lock_content'] == 'no') || |
| 4278 | (!empty(Helper::is_password_correct($client_id)) && |
| 4279 | ($hash_pass === $password_correct) ) || |
| 4280 | !apply_filters('embedpress/is_allow_rander', false) |
| 4281 | ) { |
| 4282 | if (!empty($settings['embedpress_content_share'])) { |
| 4283 | $content .= Helper::embed_content_share($content_id, $embed_settings); |
| 4284 | } |
| 4285 | echo $content; |
| 4286 | } else { |
| 4287 | if (!empty($settings['embedpress_content_share'])) { |
| 4288 | $content .= Helper::embed_content_share($content_id, $embed_settings); |
| 4289 | } |
| 4290 | do_action('embedpress/display_password_form', $client_id, $content, $pass_hash_key, $embed_settings); |
| 4291 | } |
| 4292 | ?> |
| 4293 | </div> |
| 4294 | |
| 4295 | <?php |
| 4296 | if (!empty($settings['adManager']) && (!empty(Helper::is_password_correct($client_id)) && ($hash_pass === $password_correct) )) { |
| 4297 | $content = apply_filters('embedpress/generate_ad_template', $content, $client_id, $settings, 'elementor'); |
| 4298 | } |
| 4299 | ?> |
| 4300 | </div> |
| 4301 | </div> |
| 4302 | </div> |
| 4303 | </div> |
| 4304 | <?php endif;?> |
| 4305 | |
| 4306 | </div> |
| 4307 | |
| 4308 | |
| 4309 | <?php if ($settings['embedpress_pro_embeded_source'] === 'youtube') : ?> |
| 4310 | <style> |
| 4311 | #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__block .youtube__content__body .content__wrap { |
| 4312 | grid-template-columns: repeat(auto-fit, minmax(<?php echo esc_html($calVal); ?>, 1fr)) !important; |
| 4313 | } |
| 4314 | |
| 4315 | #ep-elements-id-<?php echo esc_html($this->get_id()); ?>.ep-youtube__content__pagination { |
| 4316 | display: <?php echo esc_html($ispagination); ?> !important; |
| 4317 | } |
| 4318 | </style> |
| 4319 | <?php endif; ?> |
| 4320 | |
| 4321 | <?php |
| 4322 | } |
| 4323 | public function onAfterEmbedSpotify($embed, $setting) |
| 4324 | { |
| 4325 | if (!isset($embed->provider_name) || strtolower($embed->provider_name) !== 'spotify' || !isset($embed->embed)) { |
| 4326 | return $embed; |
| 4327 | } |
| 4328 | $match = array(); |
| 4329 | preg_match('/src=\"(.+?)\"/', $embed->embed, $match); |
| 4330 | if (empty($match)) { |
| 4331 | return $embed; |
| 4332 | } |
| 4333 | $url_full = $match[1]; |
| 4334 | $modified_url = str_replace('playlist-v2', 'playlist', $url_full); |
| 4335 | if (isset($setting['spotify_theme'])) { |
| 4336 | if (strpos($modified_url, '?') !== false) { |
| 4337 | $modified_url .= '&theme=' . sanitize_text_field($setting['spotify_theme']); |
| 4338 | } else { |
| 4339 | $modified_url .= '?theme=' . sanitize_text_field($setting['spotify_theme']); |
| 4340 | } |
| 4341 | } |
| 4342 | $embed->embed = str_replace($url_full, $modified_url, $embed->embed); |
| 4343 | return $embed; |
| 4344 | } |
| 4345 | } |
| 4346 |