Elementor Widget Generator

Home » WordPress Generators » Elementor Widget Generator
The name of the widget.
The ID of the widget.
The text domain of the widget.
The category of the widget.
The custom category of the widget.
The icon of the widget. Font Awesome Icons Gallery
The title of the content section.
The type of the field.
The label of the field.
The ID of the field.
The placeholder of the field.
                    class Custom_Elementor_Widget extends ElementorWidget_Base {
	public function get_name() {
		return 'wpturbo-mycustomelementorwidget';
	}

	public function get_title() {
		return __( 'My Custom Elementor Widget', 'wpturbo' );
	}

	public function get_icon() {
		return 'fa fa-star';
	}

	public function get_categories() {
		return array('');
	}

	protected function _register_controls() {
		$this->start_controls_section( 'content_section', array(
			'label' => __( 'My Elementor Widget Content', 'wpturbo' ),
			'tab' => ElementorControls_Manager::TAB_CONTENT,
		));

		$this->add_control( 'wpturbo-my-field', array(
			'label' => __( 'My Field', 'wpturbo' ),
			'type' => \Elementor\Controls_Manager::TEXT,
			'input_type' => '',
			'placeholder' => __( 'My Field', 'wpturbo' ),
		));

		$this->end_controls_section();
	}

	protected function render() {
		$settings = $this->get_settings_for_display();
		echo '<div class="oembed-elementor-widget">';
			echo $settings['wpturbo-my-field'];
		echo '</div>';
	}

}