/** * Redirects to a URL corrected for the language information in it, in case request URI and $_REQUEST['lang'], * requested domain or $_SERVER['REQUEST_URI'] do not match and gives precedence to the explicit language parameter if * there. * * @return string The language code of the currently requested URL in case no redirection was necessary. */ public function maybe_redirect() { if (($target = $this->redirect_helper->get_redirect_target()) !== false) { $this->sitepress->get_wp_api()->wp_safe_redirect($target); } // allow forcing the current language when it can't be decoded from the URL return $this->lang_resolution->current_lang_filter($this->request_handler->get_requested_lang()); }
/** * @param array $tax_sync_option * @param WPML_URL_Converter $url_converter * @param WPML_Request $request_handler * @param WPML_Language_Resolution $lang_resolution */ public function __construct($tax_sync_option, &$url_converter, &$request_handler, &$lang_resolution) { parent::__construct($url_converter, $request_handler, $lang_resolution); global $wp_rewrite; if (!isset($wp_rewrite)) { require_once ABSPATH . WPINC . '/rewrite.php'; $wp_rewrite = new WP_Rewrite(); } $this->term_like_params = array_merge($this->term_like_params, array_filter($tax_sync_option)); }
/** * @param array $domains * @param WPML_URL_Converter $url_converter * @param WPML_Request $request_handler * @param WPML_Language_Resolution $lang_resolution */ public function __construct($domains, &$request_handler, &$url_converter, &$lang_resolution) { parent::__construct($url_converter, $request_handler, $lang_resolution); $this->domains = $domains; }