| @@ -38,9 +38,9 @@ | ||
| 38 | 38 | * |
| 39 | 39 | * @return string Widget title. |
| 40 | 40 | */ |
| 41 | 41 | public function get_title() { |
| 42 | - return esc_html__( 'HTML', 'elementor' ); | |
| 42 | + return __( 'HTML', 'elementor' ); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Get widget icon. |
| @@ -66,23 +66,11 @@ | ||
| 66 | 66 | * |
| 67 | 67 | * @return array Widget keywords. |
| 68 | 68 | */ |
| 69 | 69 | public function get_keywords() { |
| 70 | - return [ 'html', 'code', 'embed', 'script' ]; | |
| 70 | + return [ 'html', 'code' ]; | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - protected function is_dynamic_content(): bool { | |
| 74 | - return false; | |
| 75 | - } | |
| 76 | - | |
| 77 | - public function show_in_panel() { | |
| 78 | - return User::is_current_user_can_use_custom_html(); | |
| 79 | - } | |
| 80 | - | |
| 81 | - public function has_widget_inner_wrapper(): bool { | |
| 82 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 83 | - } | |
| 84 | - | |
| 85 | 73 | /** |
| 86 | 74 | * Register HTML widget controls. |
| 87 | 75 | * |
| 88 | 76 | * Adds different input fields to allow the user to change and customize the widget settings. |
| @@ -93,9 +81,9 @@ | ||
| 93 | 81 | protected function register_controls() { |
| 94 | 82 | $this->start_controls_section( |
| 95 | 83 | 'section_title', |
| 96 | 84 | [ |
| 97 | - 'label' => esc_html__( 'HTML Code', 'elementor' ), | |
| 85 | + 'label' => __( 'HTML Code', 'elementor' ), | |
| 98 | 86 | ] |
| 99 | 87 | ); |
| 100 | 88 | |
| 101 | 89 | $this->add_control( |
| @@ -100,16 +88,13 @@ | ||
| 100 | 88 | |
| 101 | 89 | $this->add_control( |
| 102 | 90 | 'html', |
| 103 | 91 | [ |
| 104 | - 'label' => esc_html__( 'HTML Code', 'elementor' ), | |
| 92 | + 'label' => '', | |
| 105 | 93 | 'type' => Controls_Manager::CODE, |
| 106 | 94 | 'default' => '', |
| 107 | - 'placeholder' => esc_html__( 'Enter your code', 'elementor' ), | |
| 108 | - 'dynamic' => [ | |
| 109 | - 'active' => true, | |
| 110 | - ], | |
| 111 | - 'is_editable' => User::is_current_user_can_use_custom_html(), | |
| 95 | + 'placeholder' => __( 'Enter your code', 'elementor' ), | |
| 96 | + 'show_label' => false, | |
| 112 | 97 | ] |
| 113 | 98 | ); |
| 114 | 99 | |
| 115 | 100 | $this->end_controls_section(); |
| @@ -123,9 +108,9 @@ | ||
| 123 | 108 | * @since 1.0.0 |
| 124 | 109 | * @access protected |
| 125 | 110 | */ |
| 126 | 111 | protected function render() { |
| 127 | - $this->print_unescaped_setting( 'html' ); | |
| 112 | + echo $this->get_settings_for_display( 'html' ); | |
| 128 | 113 | } |
| 129 | 114 | |
| 130 | 115 | /** |
| 131 | 116 | * Render HTML widget output in the editor. |
| @@ -138,15 +123,6 @@ | ||
| 138 | 123 | protected function content_template() { |
| 139 | 124 | ?> |
| 140 | 125 | {{{ settings.html }}} |
| 141 | 126 | <?php |
| 142 | - } | |
| 143 | - | |
| 144 | - public function render_markdown(): string { | |
| 145 | - $settings = $this->get_settings_for_display(); | |
| 146 | - $html = $settings['html'] ?? ''; | |
| 147 | - if ( empty( $html ) ) { | |
| 148 | - return ''; | |
| 149 | - } | |
| 150 | - return \Elementor\Modules\MarkdownRender\Html_To_Markdown::convert( $html ); | |
| 151 | 127 | } |
| 152 | 128 | } |