← All changes
|
modules/atomic-widgets/elements/base/atomic-element-base.php
+1
-10
4.0.9
→
4.0.0-dev2
View file →
| @@ -162,13 +162,9 @@ | ||
| 162 | 162 | protected function get_html_tag(): string { |
| 163 | 163 | $settings = $this->get_atomic_settings(); |
| 164 | 164 | $default_html_tag = $this->define_default_html_tag(); |
| 165 | 165 | |
| 166 | - if ( ! empty( $settings['link']['tag'] ) ) { | |
| 167 | - return $settings['link']['tag']; | |
| 168 | - } | |
| 169 | - | |
| 170 | - return $settings['tag'] ?? $default_html_tag; | |
| 166 | + return ! empty( $settings['link']['href'] ) ? $settings['link']['tag'] : ( $settings['tag'] ?? $default_html_tag ); | |
| 171 | 167 | } |
| 172 | 168 | |
| 173 | 169 | /** |
| 174 | 170 | * Print safe HTML tag for the element based on the element settings. |
| @@ -187,13 +183,8 @@ | ||
| 187 | 183 | */ |
| 188 | 184 | protected function print_custom_attributes() { |
| 189 | 185 | $settings = $this->get_atomic_settings(); |
| 190 | 186 | $attributes = $settings['attributes'] ?? ''; |
| 191 | - | |
| 192 | - if ( isset( $settings['link']['attributes'] ) ) { | |
| 193 | - $attributes .= ' ' . ( $settings['link']['attributes'] ?? '' ); | |
| 194 | - } | |
| 195 | - | |
| 196 | 187 | if ( ! empty( $attributes ) && is_string( $attributes ) ) { |
| 197 | 188 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 198 | 189 | echo ' ' . $attributes; |
| 199 | 190 | } |