Support » Plugin: Simple Social Icons » Bug: Email URI should ignore “Open links in new window” setting

  • This is a bug report concerning the widget setting, “Open links in new window?” in Simple Social Icons version 2.0.1.

    When this checkbox is checked, and the user fills in the “Email URI” with a mailto value, Simple Social Icons adds target="_blank" to the mailto link, which I believe is a mistake. It causes a new browser window to open when the user clicks the social icon for email, in addition to an email client window. The browser window is unnecessary.

    This is in Google Chrome Version 56.0.2924.87 on Ubuntu Linux.

    Hope this helps!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi!
    Having the same issue. The mailto opens a new tab and so doesn’t go to the default email client.
    Pls Help !

    Plugin Contributor Nick Cernis

    (@modernnerd)

    Thanks for the report! I’ve filed a bug for this.

    If you’d like to test a potential fix in the meantime, you are welcome to download and try this version of the plugin.

    As far as I can tell, the required change is 3 additional lines in the plugin’s simple-social-icons.php file:

    foreach ( $profiles as $profile => $data ) {
    
            if ( empty( $instance[ $profile ] ) )
                    continue;
            /** Start of new code. */
            $new_window = $instance['new_window'] ? 'target="_blank"' : '';
            if ( strpos( $instance[ $profile ], 'mailto:' ) !== FALSE )
                    $new_window = '';
            /** End of new code. */
            if ( is_email( $instance[ $profile ] ) )
                    $output .= sprintf( $data['pattern'], 'mailto:' . esc_attr( $instance[$profile] ), $new_window );
            else
                    $output .= sprintf( $data['pattern'], esc_url( $instance[$profile] ), $new_window );
    
    }

    I couldn’t figure out how to simply replace just the widget() function in my child theme’s functions.php file, so I ended up modifying the plugin’s file directly. (Even though I know I shouldn’t be.) But I backed up the changes I made so I can easily re-implement them if need be.

    Any ideas when this will be done as an update. I have a few sites with the issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bug: Email URI should ignore “Open links in new window” setting’ is closed to new replies.