Home New Guten Forums WoodMart support forum SVG Support for Extra Menu List

SVG Support for Extra Menu List

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #362416

    techmind
    Participant

    U can add svg support for Extra Menu List images.

    #362418

    techmind
    Participant

    woodmart>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;
    										} ?>
    #362636

    Artem Temos
    Keymaster

    Hello,

    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

    #366005

    techmind
    Participant

    Yes i want <svg> tag option for fill color hover link.

    #366099

    Artem Temos
    Keymaster

    We will consider this as a feature request. Thank you.

    Kind Regards

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘SVG Support for Extra Menu List’ is closed to new replies.