Advertisement
Chouby

Polylang translates zenon lite

Dec 15th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Polylang translates zenon lite
  4. */
  5.  
  6. $config = get_option( 'optionsframework' );
  7. if (isset( $config['id'] ))
  8.     add_filter('option_' . $config['id'], 'pll_optionsframework');
  9.  
  10. function pll_optionsframework($options) {
  11.     $translations = array(
  12.         'block1_text',
  13.         'block1_textarea',
  14.         'block2_text',
  15.         'block2_textarea',
  16.         // add here other options to translate
  17.     );
  18.  
  19.     foreach ($translations as $translation) {
  20.         if (is_admin() && function_exists('pll_register_string'))
  21.             pll_register_string('zenon lite', $options[$translation]);
  22.         elseif (function_exists('pll__'))
  23.             $options[$translation] = pll__($options[$translation]);
  24.     }
  25.     return $options;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement