wp_api = $wp_api; } public function get_requested_lang() { return $this->wp_api->is_comments_post_page() ? $this->get_comment_language() : $this->get_request_uri_lang(); } /** * @return string */ private function get_comment_language() { return Maybe::of( $_POST ) ->map( Obj::prop( WPML_WP_Comments::LANG_CODE_FIELD ) ) ->map( filterVar( FILTER_SANITIZE_SPECIAL_CHARS ) ) ->getOrElse( $this->default_language ); } protected function get_cookie_name() { return $this->cookieLanguage->getFrontendCookieName(); } }