start_controls_section( '_section_dailymotion', [ 'label' => __( 'Dailymotion Content Settings', 'allembed' ), ] ); $this->add_control( 'dailymotion_link', [ 'label' => esc_html__( 'Dailymotion Link', 'allembed' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'https://your-link.com', 'allembed' ), 'default' =>'https://www.dailymotion.com/embed/video/x80yyuz', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_content_setting', [ 'label' => esc_html__( 'Dailymotion Other Settings', 'allembed' ), ] ); $this->add_control( 'width', [ 'label' => esc_html__( 'Width', 'allembed' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1500, 'step' => 5, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 640, ], 'selectors' => [ '{{WRAPPER}} .dailymo iframe' => 'max-width: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'height', [ 'label' => esc_html__( 'Height', 'allembed' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1500, 'step' => 5, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 315, ], 'selectors' => [ '{{WRAPPER}} .dailymo iframe' => 'height: {{SIZE}}{{UNIT}}', ], ] ); } /** * Render the widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $dailymotion_link = $settings['dailymotion_link']; ?>