private function maybe_setup_rootpage()
 {
     if (WPML_Root_Page::is_current_request_root()) {
         if (WPML_Root_Page::uses_html_root()) {
             $html_file = (false === strpos($this->urls['root_html_file_path'], '/') ? ABSPATH : '') . $this->urls['root_html_file_path'];
             /** @noinspection PhpIncludeInspection */
             include $html_file;
             exit;
         } else {
             $root_page_actions = wpml_get_root_page_actions_obj();
             $root_page_actions->wpml_home_url_setup_root_page();
         }
     }
 }
Esempio n. 2
0
 /**
  * @param $query_string string
  *
  * Checks if the WP_Query functionality can decisively recognize if a querystring points
  * towards an archive.
  *
  * @return bool
  */
 private static function query_points_to_archive($query_string)
 {
     $root_page_actions = wpml_get_root_page_actions_obj();
     remove_action('parse_query', array($root_page_actions, 'wpml_home_url_parse_query'));
     $query_string = str_replace('?', '', $query_string);
     $query = new WP_Query($query_string);
     $is_archive = $query->is_archive();
     add_action('parse_query', array($root_page_actions, 'wpml_home_url_parse_query'));
     return $is_archive;
 }
Esempio n. 3
0
 /**
  * @return WPML_Root_Page_Actions
  */
 public function get_root_page_utils()
 {
     return wpml_get_root_page_actions_obj();
 }