public function redirect() { $domain = $this->domainAdapter->getCurrentById(); if ($domain && $domain->domain != $this->currentBlog->domain) { $request = str_replace(untrailingslashit($this->currentBlog->path), '', $_SERVER['REQUEST_URI']); $url = new Url($domain->domain, $request); wp_redirect($url->build(), 301); die; } }
public function getContentUrl(\stdClass $blog = null) { if (!$blog) { $domain = DOMAIN_CURRENT_SITE; } else { $domain = $blog->domain; } if (defined('CONTENT_DIR')) { $contentDir = CONTENT_DIR; } else { $contentDir = '/wp-content'; } $url = new Url($domain, $contentDir); return $url->build(); }