WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Bilingual Linker] Feature request

[Resolved] [Plugin: Bilingual Linker] Feature request

  • 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)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [Plugin: Bilingual Linker] Feature request’ is closed to new replies.