
Polylang translates bizway strings
By:
Chouby on
Nov 7th, 2012 | syntax:
PHP | size: 0.63 KB | hits: 52 | expires: Never
<?php
/*
Plugin Name: Polylang translates bizway strings
*/
add_filter('option_bizway_options', 'translate_bizway_options');
function translate_bizway_options($options) {
if (function_exists('pll_register_string')) {
$to_translate = array('bizway_first_head', 'bizway_second_head', 'bizway_firsthead', 'bizway_firstdesc', 'bizway_secondhead', 'bizway_seconddesc', 'bizway_thirdhead', 'bizway_thirddesc');
foreach ($options as $key=>$option) {
if (in_array($key, $to_translate)) {
if (is_admin())
pll_register_string($key, $option);
else
$options[$key] = pll__($option);
}
}
}
return $options;
}