wpml-translation-job-helper.class.php
932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
class WPML_Translation_Job_Helper {
public function encode_field_data( $data ) {
return null === $data ? '' : base64_encode( $data );
}
public function decode_field_data( $data, $format ) {
return $this->get_core_translation_management()->decode_field_data( $data, $format );
}
protected function get_tm_setting( $indexes ) {
$core_tm = $this->get_core_translation_management();
if ( empty( $core_tm->settings ) ) {
$core_tm->init();
}
$settings = $core_tm->get_settings();
foreach ( $indexes as $index ) {
$settings = isset( $settings[ $index ] ) ? $settings[ $index ] : null;
if ( ! isset( $settings ) ) {
break;
}
}
return $settings;
}
/**
* @return TranslationManagement
*/
public static function get_core_translation_management() {
/** TranslationManagement $iclTranslationManagement */
global $iclTranslationManagement;
return $iclTranslationManagement;
}
}