PluginProbe
Themify Builder / trunk
Themify Builder vtrunk
7.8.1 7.8.0 7.7.9 7.7.8 7.7.7 7.7.6 7.7.5 7.7.4 7.7.3 7.7.2 trunk 7.6.0 7.6.1 7.6.2 7.6.3 7.6.4 7.6.5 7.6.6 7.6.7 7.6.8 7.6.9 7.7.0 7.7.1
themify-builder / themify / plugin-compat / wpmlstrings.php

wpmlstrings.php in Themify Builder trunk, at themify/plugin-compat/wpmlstrings.php

51 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Themify Compatibility Code
4 *
5 * @package Themify
6 */
7
8 /**
9 * WPML String Translation
10 * @link https://wpml.org/
11 */
12 class Themify_Compat_wpmlstrings {
13
14 static function init() {
15 if ( function_exists( 'icl_register_string' ) ) {
16 self::register_wpml_strings( 'Themify', 'Themify Option', themify_get_data() );
17 }
18 }
19
20 /**
21 * Make dynamic strings in Themify theme available for translation with WPML String Translation
22 * @param $context
23 * @param $name
24 * @param $value
25 * @since 1.5.3
26 */
27 public static function register_wpml_strings( $context, $name, $value ) {
28 $value = maybe_unserialize( $value );
29 if ( is_array( $value ) ) {
30 foreach ( $value as $k => $v ) {
31 self::register_wpml_strings( $context, $k, $v );
32 }
33 } else {
34 $translatable = array(
35 'setting-footer_text_left',
36 'setting-footer_text_right',
37 'setting-homepage_welcome',
38 'setting-action_text',
39 'setting-default_more_text',
40 );
41 foreach ( array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten') as $option ) {
42 $translatable[] = 'setting-slider_images_' . $option . '_title';
43 $translatable[] = 'setting-header_slider_images_' . $option . '_title';
44 $translatable[] = 'setting-footer_slider_images_' . $option . '_title';
45 }
46 if (stripos( $name, 'title_themify-link' ) || in_array( $name, $translatable, true ) ) {
47 icl_register_string( $context, $name, $value );
48 }
49 }
50 }
51 }