It’s working, checkout the raw page source. See FAQ.
Hi,
could you check my problem as well.
Your plugin work perfectly, except custom link in footer menu section in wp theme-2017 v4.9.7.
I’m adding custom link to the footer with mailto and you can see full email address (now I have some fake email test@test.com).
here is the page link – https://viktoriasailing.me/
thanks for help
@bartekj: What theme are you using and is the footer widget part of that theme?
Hi,
I am using twenty seventeen and yes widget is a part of the theme.
Ah, I see. The “Social Links Menu” is configured through a navigation menu, isn’t it? Could you send me a screenshot of the backend where you setup the links?
here is screen https://postimg.cc/image/59tdoky07/
it is in custom link and in the Menu Settings below display location is Social Links Menu
You’ll have to manually encode navigation links in that case:
add_filter( 'nav_menu_link_attributes', function ( $atts ) {
$atts[ 'href' ] = eae_encode_emails( $atts[ 'href' ] );
return $atts;
});
See if that works.
hi,
thanks for answer.
Now it almost works.
Now email is hidden but I don’t know why it change as well href string => mailto: to regular link http, and when I refresh page, some times it is link to my page and some times it works as expected?
You gotta play with it a little bit. Maybe it’s the filter priority:
add_filter( 'nav_menu_link_attributes', function ( $atts ) {
$atts[ 'href' ] = eae_encode_emails( $atts[ 'href' ] );
return $atts;
}, 1000);
Or maybe add an @-sign check:
add_filter( 'nav_menu_link_attributes', function ( $atts ) {
if ( strpos( $atts[ 'href' ], '@' ) !== false ) {
$atts[ 'href' ] = eae_encode_emails( $atts[ 'href' ] );
}
return $atts;
}, 1000);
Hi,
I have same problem, but none of the 3 codes work. Last one is most promising but it adds http before mailto and link is not correct.
Best regards,
Marko
@marxveix: Have you considered using the premium version? It handles all links automatically without the need to figure out filters.