first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
class WPML_Language {
/** @var SitePress $sitepress */
private $sitepress;
/** @var string $code */
private $code;
private $lang_details;
public function __construct( SitePress $sitepress, $code ) {
$this->sitepress = $sitepress;
$this->code = $code;
$this->lang_details = $sitepress->get_language_details( $code );
}
public function is_valid() {
return (bool) $this->lang_details;
}
public function get_code() {
return $this->lang_details['code'];
}
public function get_display_name() {
return $this->lang_details['display_name'];
}
public function get_flag_url() {
return $this->sitepress->get_flag_url( $this->code );
}
}