start_controls_section( '_section_facebook', [ 'label' => __( 'Facebook Content Settings', 'allembed' ), ] ); $this->add_control( 'facebook_link', [ 'label' => esc_html__( 'Facebook Link', 'allembed' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'https://your-link.com', 'allembed' ), 'default' =>'https://www.facebook.com/plugins/video.php?height=476&href=https%3A%2F%2Fwww.facebook.com%2F5min.crafts%2Fvideos%2F849635402563473%2F&show_text=false&width=476', ] ); $this->end_controls_section(); $this->start_controls_section( 'facebook_ttabb', [ 'label' =>esc_html__( 'Facebook 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' => 555, ], 'selectors' => [ '{{WRAPPER}} .faceboo 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' => 560, ], 'selectors' => [ '{{WRAPPER}} .faceboo iframe' => 'height: {{SIZE}}{{UNIT}}', ], ] ); $this->end_controls_section(); } /** * 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(); $facebook_link = $settings['facebook_link']; ?>