: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/** @var SitePress $sitepress */
public function __construct( SitePress $sitepress, $code ) {
$this->sitepress = $sitepress;
$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 );