05/06/2016 at 2:14 pm
#375451
Participant
In case it can help someone, since I have a multilingual website using wpml and that I use WPML Shortcodes here is the final code to make this work with 2 languages:
add_filter( 'cn_output_link', 'th_cn_output_link', 10, 4 );
function th_cn_output_link( $html, $link, $entry, $atts) {
$url = cnSanitize::field( 'url', $link->url );
$th_langue = wpml_e__if_language( 'Visit us on the web !', 'en' ); wpml_e__if_language( 'Visitez-nous sur le web !', 'fr' );
$html = '<a class="url" href="' . $url . '" target="_blank">' . $th_langue . '</a>';
return $html;
}
-
This reply was modified 10 years, 3 months ago by
Steven Zahm. Reason: Fix code block
