Home New Guten › Forums › WoodMart support forum › SVG Support for Extra Menu List
SVG Support for Extra Menu List
- This topic has 4 replies, 2 voices, and was last updated 3 years, 4 months ago by
Artem Temos.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
March 20, 2022 at 11:45 am #362416
techmindParticipantU can add svg support for Extra Menu List images.
March 20, 2022 at 11:53 am #362418
techmindParticipantwoodmart>inc>integrations>elementor>elements> class-extra-menu-list.php
Change -> Line 425<?php if ( $settings['image'] ) : ?> <?php echo woodmart_get_image_html( $settings, 'image' ); ?> <?php endif; ?>
To
<?php if ( $settings['image'] ) { $rand = 'svg-' . rand( 999, 9999 ); $custom_image_size = isset( $settings['image_custom_dimension']['width'] ) && $settings['image_custom_dimension']['width'] ? $settings['image_custom_dimension'] : [ 'width' => 18, 'height' => 18, ]; if ( isset( $settings['image']['id'] ) && $settings['image']['id'] ) { $image_output = woodmart_get_image_html( $settings, 'image' ); if ( woodmart_is_svg( woodmart_get_image_url( $settings['image']['id'], 'image', $settings ) ) ) { $image_out = '<span class="extra-menu-svg-wrapper extra-menu-icon" style="width:' . esc_attr( $custom_image_size['width'] ) . 'px; height:' . esc_attr( $custom_image_size['height'] ) . 'px;">' . woodmart_get_any_svg( woodmart_get_image_url( $settings['image']['id'], 'image', $settings ), $rand ) . '</span>'; } } echo $image_out; } ?>
And Change -> Line 477
<?php if ( $item['image'] ) : ?> <?php echo woodmart_get_image_html( $item, 'image' ); ?> <?php endif; ?>
To
<?php if ( $item['image'] ) { $rand = 'svg-' . rand( 999, 9999 ); $custom_image_size = isset( $item['image_custom_dimension']['width'] ) && $item['image_custom_dimension']['width'] ? $item['image_custom_dimension'] : [ 'width' => 18, 'height' => 18, ]; if ( isset( $settings['image']['id'] ) && $item['image']['id'] ) { $image_output = woodmart_get_image_html( $item, 'image' ); if ( woodmart_is_svg( woodmart_get_image_url( $item['image']['id'], 'image', $settings ) ) ) { $image_output = '<span class="extra-menu-svg-wrapper extra-menu-icon" style="width:' . esc_attr( $custom_image_size['width'] ) . 'px; height:' . esc_attr( $custom_image_size['height'] ) . 'px;">' . woodmart_get_any_svg( woodmart_get_image_url( $item['image']['id'], 'image', $settings ), $rand ) . '</span>'; } } echo $image_output; } ?>
March 21, 2022 at 10:41 am #362636
Artem TemosKeymasterHello,
SVG images are allowed there but they will be shown as an
<img>
tag, not as<svg>
. Do you need to display SVG markup there?Kind Regards
April 3, 2022 at 4:15 pm #366005
techmindParticipantYes i want
<svg>
tag option for fill color hover link.April 4, 2022 at 7:03 am #366099
Artem TemosKeymasterWe will consider this as a feature request. Thank you.
Kind Regards
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
The topic ‘SVG Support for Extra Menu List’ is closed to new replies.
- You must be logged in to create new topics. Login / Register