start_controls_section( 'settings_section', array( 'label' => esc_html__('Settings', 'wpmf'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT ) ); $this->add_control( 'wpmf_add_file_design', array( 'label' => esc_html__('Choose file', 'wpmf'), 'type' => \Elementor\Controls_Manager::BUTTON, 'text' => esc_html__('Add a file', 'wpmf'), ) ); $this->add_responsive_control( 'content_align', array( 'label' => __('Alignment', 'wpmf'), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => array( 'left' => array( 'title' => __('Left', 'wpmf'), 'icon' => 'fa fa-align-left' ), 'center' => array( 'title' => __('Center', 'wpmf'), 'icon' => 'fa fa-align-center' ), 'right' => array( 'title' => __('Right', 'wpmf'), 'icon' => 'fa fa-align-right' ) ), 'devices' => array('desktop', 'tablet'), 'prefix_class' => 'content-align-%s', ) ); $this->add_control( 'wpmf_file_design_id', array( 'label' => esc_html__('File ID', 'wpmf'), 'type' => \Elementor\Controls_Manager::NUMBER, ) ); $this->end_controls_section(); } /** * Render File Design widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @return void|string */ protected function render() { $settings = $this->get_settings_for_display(); $id = (isset($settings['wpmf_file_design_id']) && $settings['wpmf_file_design_id'] !== '') ? $settings['wpmf_file_design_id'] : 0; if (!empty($id)) { echo do_shortcode('[wpmffiledesign id="' . esc_attr($id) . '"]'); } else { ?>