Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Polylang translates bizway strings

By: Chouby on Nov 7th, 2012  |  syntax: PHP  |  size: 0.63 KB  |  hits: 84  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. /*
  3. Plugin Name: Polylang translates bizway strings
  4. */
  5.  
  6. add_filter('option_bizway_options', 'translate_bizway_options');
  7.  
  8. function translate_bizway_options($options) {
  9.         if (function_exists('pll_register_string')) {
  10.                 $to_translate = array('bizway_first_head', 'bizway_second_head', 'bizway_firsthead', 'bizway_firstdesc', 'bizway_secondhead', 'bizway_seconddesc', 'bizway_thirdhead', 'bizway_thirddesc');
  11.                 foreach ($options as $key=>$option) {
  12.                         if (in_array($key, $to_translate)) {
  13.                                 if (is_admin())
  14.                                         pll_register_string($key, $option);
  15.                                 else
  16.                                         $options[$key] = pll__($option);
  17.                         }
  18.                 }
  19.         }
  20.         return $options;
  21. }