| @@ -115,30 +115,8 @@ | ||
| 115 | 115 | * Register video widget controls. |
| 116 | 116 | * |
| 117 | 117 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 118 | 118 | * |
| 119 | - * @since 3.19.0 | |
| 120 | - * @access protected | |
| 121 | - * | |
| 122 | - * @return array Widget promotion data. | |
| 123 | - */ | |
| 124 | - protected function get_upsale_data() { | |
| 125 | - return [ | |
| 126 | - 'condition' => ! Utils::has_pro(), | |
| 127 | - 'image' => esc_url( ELEMENTOR_ASSETS_URL . 'images/go-pro.svg' ), | |
| 128 | - 'image_alt' => esc_attr__( 'Upgrade', 'elementor' ), | |
| 129 | - 'title' => esc_html__( "Grab your visitors' attention", 'elementor' ), | |
| 130 | - 'description' => esc_html__( 'Get the Video Playlist widget and grow your toolbox with Elementor Pro.', 'elementor' ), | |
| 131 | - 'upgrade_url' => esc_url( 'https://go.elementor.com/go-pro-video-widget/' ), | |
| 132 | - 'upgrade_text' => esc_html__( 'Upgrade Now', 'elementor' ), | |
| 133 | - ]; | |
| 134 | - } | |
| 135 | - | |
| 136 | - /** | |
| 137 | - * Register video widget controls. | |
| 138 | - * | |
| 139 | - * Adds different input fields to allow the user to change and customize the widget settings. | |
| 140 | - * | |
| 141 | 119 | * @since 3.1.0 |
| 142 | 120 | * @access protected |
| 143 | 121 | */ |
| 144 | 122 | protected function register_controls() { |
| @@ -626,8 +604,18 @@ | ||
| 626 | 604 | ], |
| 627 | 605 | ] |
| 628 | 606 | ); |
| 629 | 607 | |
| 608 | + if ( ! Utils::has_pro() ) { | |
| 609 | + $this->add_control( | |
| 610 | + Utils::VIDEO_PLAYLIST . '_promotion', | |
| 611 | + [ | |
| 612 | + 'label' => esc_html__( 'Video Playlist widget', 'elementor' ), | |
| 613 | + 'type' => Promotion_Control::TYPE, | |
| 614 | + ] | |
| 615 | + ); | |
| 616 | + } | |
| 617 | + | |
| 630 | 618 | $this->end_controls_section(); |
| 631 | 619 | |
| 632 | 620 | $this->start_controls_section( |
| 633 | 621 | 'section_image_overlay', |
| @@ -1048,9 +1036,9 @@ | ||
| 1048 | 1036 | |
| 1049 | 1037 | if ( $is_static_render_mode ) { |
| 1050 | 1038 | $video_html = Embed::get_embed_thumbnail_html( $video_url, $post_id ); |
| 1051 | 1039 | // YouTube API requires a different markup which was set above. |
| 1052 | - } elseif ( 'youtube' !== $settings['video_type'] ) { | |
| 1040 | + } else if ( 'youtube' !== $settings['video_type'] ) { | |
| 1053 | 1041 | $video_html = Embed::get_embed_html( $video_url, $embed_params, $embed_options ); |
| 1054 | 1042 | } |
| 1055 | 1043 | } |
| 1056 | 1044 | |
| @@ -1411,28 +1399,6 @@ | ||
| 1411 | 1399 | /* Sometimes the video url is base64, therefore we use `esc_attr` in `src`. */ |
| 1412 | 1400 | ?> |
| 1413 | 1401 | <video class="elementor-video" src="<?php echo esc_attr( $video_url ); ?>" <?php Utils::print_html_attributes( $video_params ); ?>></video> |
| 1414 | 1402 | <?php |
| 1415 | - } | |
| 1416 | - | |
| 1417 | - public function render_markdown(): string { | |
| 1418 | - $settings = $this->get_settings_for_display(); | |
| 1419 | - $video_type = $settings['video_type'] ?? 'youtube'; | |
| 1420 | - $url = ''; | |
| 1421 | - | |
| 1422 | - if ( 'hosted' === $video_type ) { | |
| 1423 | - if ( ! empty( $settings['insert_url'] ) ) { | |
| 1424 | - $url = $settings['external_url']['url'] ?? ''; | |
| 1425 | - } else { | |
| 1426 | - $url = $settings['hosted_url']['url'] ?? ''; | |
| 1427 | - } | |
| 1428 | - } else { | |
| 1429 | - $url = $settings[ $video_type . '_url' ] ?? ''; | |
| 1430 | - } | |
| 1431 | - | |
| 1432 | - if ( empty( $url ) ) { | |
| 1433 | - return ''; | |
| 1434 | - } | |
| 1435 | - | |
| 1436 | - return '[Video](' . esc_url( $url ) . ')'; | |
| 1437 | 1403 | } |
| 1438 | 1404 | } |