Merge branch 'master' into grunt
This commit is contained in:
@@ -138,12 +138,9 @@ add_filter('body_class', 'roots_body_class');
|
|||||||
* @author Scott Walkinshaw <scott.walkinshaw@gmail.com>
|
* @author Scott Walkinshaw <scott.walkinshaw@gmail.com>
|
||||||
*/
|
*/
|
||||||
function roots_root_relative_url($input) {
|
function roots_root_relative_url($input) {
|
||||||
$parsed_url = parse_url(site_url());
|
|
||||||
$site_domain = $parsed_url['host'];
|
|
||||||
|
|
||||||
preg_match('|https?://([^/]+)(/.*)|i', $input, $matches);
|
preg_match('|https?://([^/]+)(/.*)|i', $input, $matches);
|
||||||
|
|
||||||
if (isset($matches[1]) && isset($matches[2]) && $matches[1] === $site_domain) {
|
if (isset($matches[1]) && isset($matches[2]) && $matches[1] === $_SERVER['SERVER_NAME']) {
|
||||||
return wp_make_link_relative($input);
|
return wp_make_link_relative($input);
|
||||||
} else {
|
} else {
|
||||||
return $input;
|
return $input;
|
||||||
|
|||||||
Reference in New Issue
Block a user