2013-05-22, 20:17:05
(This post was last modified: 2013-05-22, 20:19:04 by oldRemovedUser.)
While messing around with the plugin i18n I've found a quick and dirty way to realize that by dropping this code at i18n_base.php
I hope it's useful for other people too.
Code:
// custom related stuff...
function check_if_lang_exists()
{
$lang = $_GET['lang'];
if (!ctype_alpha($lang))
return false;
if (!in_array($lang,return_i18n_available_languages(return_page_slug())))
echo '<p style="padding:5px;text-align:center;border:2px solid orange;">Sorry, we could not find the requested language.</p>';
}
add_action('content-top','check_if_lang_exists');
I hope it's useful for other people too.