class-wpml-upgrade-localizations-files.php
997 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
44
45
46
47
48
<?php
/**
* @author OnTheGo Systems
*/
class WPML_Upgrade_Localization_Files implements IWPML_Upgrade_Command {
private $download_localization;
private $results = null;
/** @var SitePress */
private $sitepress;
/**
* WPML_Upgrade_Localization_Files constructor.
*
* @param array $args
*/
public function __construct( array $args ) {
$this->sitepress = $args[0];
$this->download_localization = new WPML_Download_Localization( $this->sitepress->get_active_languages(), $this->sitepress->get_default_language() );
}
public function run_admin() {
if ( ! $this->sitepress->get_wp_api()->is_back_end() ) {
return false;
}
$this->results = $this->download_localization->download_language_packs();
return true;
}
public function run_ajax() {
return false;
}
public function run_frontend() {
return false;
}
public function get_command_id() {
return 'wpml-upgrade-localization-files';
}
public function get_results() {
return $this->results;
}
}