Support » Plugin: Bilingual Linker » [Plugin: Bilingual Linker] Feature request

  • Resolved miqronaut

    (@miqronaut)


    Yannick, thanks for building and improving this plugin! Wondering if you could add optional parameters to OutputBilingualLink: default url (in case no $otherlangurl), link title (e.g., name of language here), and doecho (true=echo, false=return the link). Something like:

    function OutputBilingualLink($post_id, $linktext = "Translation", $beforelink = "<div class='BilingualLink'>", $afterlink = "</div>", $defaulturl = "#", $linktitle = "", $doecho = false)
    {
    	$otherlangurl = get_post_meta($post_id, "bilingual-linker-other-lang-url", true);
    	if ($otherlangurl != '')
    	{
    		$langlink = $beforelink . '<a href="' . $otherlangurl . '" title="' . $linktitle . '">' . $linktext . '</a>' . $afterlink;
    	} else {
    		$langlink = $beforelink . '<a href="' . $defaulturl . '" title="' . $linktitle . '">' . $linktext . '</a>' . $afterlink;
    	}
    	if ($doecho) {
    		echo ($langlink);
    	} else {
    		return $langlink;
    	}
    }

    http://wordpress.org/extend/plugins/bilingual-linker/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Yannick Lefebvre

    (@jackdewey)

    Check out version 1.2.3 for this functionality. Let me know if it works as requested, and mark the issue as closed if it does.

    Cheers.

    Sorry for the long delay in marking this as resolved. Works like a charm. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Bilingual Linker] Feature request’ is closed to new replies.