| @@ -38,9 +38,9 @@ | ||
| 38 | 38 | * |
| 39 | 39 | * @return string Widget title. |
| 40 | 40 | */ |
| 41 | 41 | public function get_title() { |
| 42 | - return esc_html__( 'Shortcode', 'elementor' ); | |
| 42 | + return __( 'Shortcode', 'elementor' ); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Get widget icon. |
| @@ -83,12 +83,8 @@ | ||
| 83 | 83 | public function is_reload_preview_required() { |
| 84 | 84 | return true; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public function has_widget_inner_wrapper(): bool { | |
| 88 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 89 | - } | |
| 90 | - | |
| 91 | 87 | /** |
| 92 | 88 | * Register shortcode widget controls. |
| 93 | 89 | * |
| 94 | 90 | * Adds different input fields to allow the user to change and customize the widget settings. |
| @@ -99,9 +95,9 @@ | ||
| 99 | 95 | protected function register_controls() { |
| 100 | 96 | $this->start_controls_section( |
| 101 | 97 | 'section_shortcode', |
| 102 | 98 | [ |
| 103 | - 'label' => esc_html__( 'Shortcode', 'elementor' ), | |
| 99 | + 'label' => __( 'Shortcode', 'elementor' ), | |
| 104 | 100 | ] |
| 105 | 101 | ); |
| 106 | 102 | |
| 107 | 103 | $this->add_control( |
| @@ -106,16 +102,13 @@ | ||
| 106 | 102 | |
| 107 | 103 | $this->add_control( |
| 108 | 104 | 'shortcode', |
| 109 | 105 | [ |
| 110 | - 'label' => esc_html__( 'Enter your shortcode', 'elementor' ), | |
| 106 | + 'label' => __( 'Enter your shortcode', 'elementor' ), | |
| 111 | 107 | 'type' => Controls_Manager::TEXTAREA, |
| 112 | 108 | 'dynamic' => [ |
| 113 | 109 | 'active' => true, |
| 114 | 110 | ], |
| 115 | - 'ai' => [ | |
| 116 | - 'active' => false, | |
| 117 | - ], | |
| 118 | 111 | 'placeholder' => '[gallery id="123" size="medium"]', |
| 119 | 112 | 'default' => '', |
| 120 | 113 | ] |
| 121 | 114 | ); |
| @@ -133,15 +126,11 @@ | ||
| 133 | 126 | */ |
| 134 | 127 | protected function render() { |
| 135 | 128 | $shortcode = $this->get_settings_for_display( 'shortcode' ); |
| 136 | 129 | |
| 137 | - if ( empty( $shortcode ) ) { | |
| 138 | - return; | |
| 139 | - } | |
| 140 | - | |
| 141 | 130 | $shortcode = do_shortcode( shortcode_unautop( $shortcode ) ); |
| 142 | 131 | ?> |
| 143 | - <div class="elementor-shortcode"><?php echo $shortcode; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div> | |
| 132 | + <div class="elementor-shortcode"><?php echo $shortcode; ?></div> | |
| 144 | 133 | <?php |
| 145 | 134 | } |
| 146 | 135 | |
| 147 | 136 | /** |
| @@ -153,9 +142,9 @@ | ||
| 153 | 142 | * @access public |
| 154 | 143 | */ |
| 155 | 144 | public function render_plain_content() { |
| 156 | 145 | // In plain mode, render without shortcode |
| 157 | - $this->print_unescaped_setting( 'shortcode' ); | |
| 146 | + echo $this->get_settings( 'shortcode' ); | |
| 158 | 147 | } |
| 159 | 148 | |
| 160 | 149 | /** |
| 161 | 150 | * Render shortcode widget output in the editor. |
| @@ -165,15 +154,5 @@ | ||
| 165 | 154 | * @since 2.9.0 |
| 166 | 155 | * @access protected |
| 167 | 156 | */ |
| 168 | 157 | protected function content_template() {} |
| 169 | - | |
| 170 | - public function render_markdown(): string { | |
| 171 | - $settings = $this->get_settings_for_display(); | |
| 172 | - $shortcode = $settings['shortcode'] ?? ''; | |
| 173 | - if ( empty( $shortcode ) ) { | |
| 174 | - return ''; | |
| 175 | - } | |
| 176 | - $output = do_shortcode( $shortcode ); | |
| 177 | - return Utils::html_to_plain_text( $output ); | |
| 178 | - } | |
| 179 | 158 | } |