WordPress.org

Forums

Bilingual Linker
[resolved] Feature request (3 posts)

  1. miqronaut
    Member
    Posted 1 year ago #

    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/

  2. Yannick Lefebvre
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. miqronaut
    Member
    Posted 10 months ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic