| @@ -8,8 +8,9 @@ | ||
| 8 | 8 | /** |
| 9 | 9 | * Elementor HTML widget. |
| 10 | 10 | * |
| 11 | 11 | * Elementor widget that insert a custom HTML code into the page. |
| 12 | + * | |
| 12 | 13 | */ |
| 13 | 14 | class Widget_Read_More extends Widget_Base { |
| 14 | 15 | |
| 15 | 16 | /** |
| @@ -67,16 +68,8 @@ | ||
| 67 | 68 | public function get_keywords() { |
| 68 | 69 | return [ 'read', 'more', 'tag', 'excerpt' ]; |
| 69 | 70 | } |
| 70 | 71 | |
| 71 | - protected function is_dynamic_content(): bool { | |
| 72 | - return false; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public function has_widget_inner_wrapper(): bool { | |
| 76 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 77 | - } | |
| 78 | - | |
| 79 | 72 | /** |
| 80 | 73 | * Register HTML widget controls. |
| 81 | 74 | * |
| 82 | 75 | * Adds different input fields to allow the user to change and customize the widget settings. |
| @@ -107,15 +100,15 @@ | ||
| 107 | 100 | |
| 108 | 101 | $this->add_control( |
| 109 | 102 | 'theme_support', |
| 110 | 103 | [ |
| 111 | - 'type' => Controls_Manager::ALERT, | |
| 112 | - 'alert_type' => 'warning', | |
| 113 | - 'content' => sprintf( | |
| 104 | + 'type' => Controls_Manager::RAW_HTML, | |
| 105 | + 'raw' => sprintf( | |
| 114 | 106 | /* translators: %s: The `the_content` function. */ |
| 115 | 107 | esc_html__( 'Note: This widget only affects themes that use `%s` in archive pages.', 'elementor' ), |
| 116 | 108 | 'the_content' |
| 117 | 109 | ), |
| 110 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', | |
| 118 | 111 | ] |
| 119 | 112 | ); |
| 120 | 113 | |
| 121 | 114 | $this->add_control( |
| @@ -155,16 +148,6 @@ | ||
| 155 | 148 | protected function content_template() { |
| 156 | 149 | ?> |
| 157 | 150 | <!--more {{ settings.link_text }}--> |
| 158 | 151 | <?php |
| 159 | - } | |
| 160 | - | |
| 161 | - public function render_markdown(): string { | |
| 162 | - $settings = $this->get_settings_for_display(); | |
| 163 | - $text = Utils::html_to_plain_text( $settings['link_text'] ?? 'Read More' ); | |
| 164 | - $url = ( $settings['link'] ?? [] )['url'] ?? ''; | |
| 165 | - if ( ! empty( $url ) ) { | |
| 166 | - return '[' . $text . '](' . esc_url( $url ) . ')'; | |
| 167 | - } | |
| 168 | - return $text; | |
| 169 | 152 | } |
| 170 | 153 | } |