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>';
}
}