class-wpml-tm-upgrade-default-editor-for-old-jobs.php
878 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
41
42
43
<?php
class WPML_TM_Upgrade_Default_Editor_For_Old_Jobs implements IWPML_Upgrade_Command {
/** @var SitePress */
private $sitepress;
public function __construct( $args ) {
$this->sitepress = $args[0];
}
/**
* @return bool
*/
private function run() {
$default = get_option( WPML_TM_Old_Jobs_Editor::OPTION_NAME );
if ( ! $default ) {
$method = $this->sitepress->get_setting( 'doc_translation_method' );
$default = WPML_TM_Editors::ATE === strtolower( $method ) ? WPML_TM_Editors::ATE : WPML_TM_Editors::WPML;
update_option( WPML_TM_Old_Jobs_Editor::OPTION_NAME, $default );
}
return true;
}
public function run_admin() {
return $this->run();
}
public function run_ajax() {
return $this->run();
}
public function run_frontend() {
return $this->run();
}
/** @return bool */
public function get_results() {
return true;
}
}