start_controls_section( 'section_form', array( 'label' => __( 'Form', 'fieldwren' ) ) ); $this->add_control( 'form_id', array( 'label' => __( 'Form', 'fieldwren' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => Embed::form_options(), 'default' => '', ) ); $this->add_control( 'show_title', array( 'label' => __( 'Show title', 'fieldwren' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'return_value' => 'yes', ) ); $this->end_controls_section(); } protected function render() { $s = $this->get_settings_for_display(); if ( empty( $s['form_id'] ) ) { if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) { echo '
' . esc_html__( 'Choose a form.', 'fieldwren' ) . '
'; } return; } echo Renderer::render( (int) $s['form_id'], array( 'title' => $s['show_title'] ) ); // phpcs:ignore } }