start_controls_section( '_section_map', [ 'label' => __( 'Map Content Settings', 'allembed' ), ] ); $this->add_control( 'map_link', [ 'label' => esc_html__( 'Map Link', 'allembed' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'https://your-link.com', 'allembed' ), 'default' =>'https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d18877570.209776115!2d-113.73807541844722!3d54.72033878549525!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4b0d03d337cc6ad9%3A0x9968b72aa2438fa5!2sCanada!5e0!3m2!1sen!2sbd!4v1620103418556!5m2!1sen!2sbd', ] ); $this->end_controls_section(); $this->start_controls_section( 'map_ttabb', [ 'label' =>esc_html__( 'Map 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' => 655, ], 'selectors' => [ '{{WRAPPER}} .gmap 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}} .gmap 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(); $map_link = $settings['map_link']; ?>