• Resolved dependencyinjection

    (@dependencyinjection)


    Hi! First, the plugin is cool!

    Can you please add such a simple thing to do not make an image clickable? It’s not always needed
    email-template-customizer-for-woo/includes/email-render.php

    public function render_html_image( $props ) {

    If $href is empty, don’t render the link at all. Now it just put the empty anchor link which is not user-friendly

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support angelagrey

    (@angelagrey)

    Hi,

    Thank you for reaching out to us.

    Yes, we’ve made it. You can modify the free version, or wait for the official update.

    public function render_html_image( $props ) {
       $src      = isset( $props['attrs']['src'] ) ? $props['attrs']['src'] : '';
       $width    = isset( $props['childStyle']['img'] ) ? $this->parse_styles( $props['childStyle']['img'] ) : '';
       $ol_width = ! empty( $props['childStyle']['img']['width'] ) ? str_replace( 'px', '', $props['childStyle']['img']['width'] ) : '100%';
       $href     = ! empty( $props['attrs']['data-href'] ) ? $props['attrs']['data-href'] : '';
       $alt      = ! empty( $props['attrs']['data-alt'] ) ? $props['attrs']['data-alt'] : '';
       if ( ! empty( $href ) ) {
          ?>
               <a href="<?php echo esc_attr( $href ) ?>" target="_blank">
          <?php
       }
       ?>
           <img alt="<?php echo esc_attr( $alt ); ?>"
                width="<?php echo esc_attr( $ol_width ) ?>"
                src='<?php echo esc_url( $src ) ?>' max-width='100%'
                style='max-width: 100%;vertical-align: middle;<?php echo esc_attr( $width ) ?>'/>
       <?php
       if ( ! empty( $href ) ) {
          ?>
               </a>
          <?php
       }
    }

    Best regards.

    Thread Starter dependencyinjection

    (@dependencyinjection)

    Thank you for a quick reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘No link for the image’ is closed to new replies.