Merge branch 'master' into grunt

This commit is contained in:
Ben Word
2013-05-10 15:17:43 -05:00
2 changed files with 5 additions and 8 deletions

View File

@@ -138,12 +138,9 @@ add_filter('body_class', 'roots_body_class');
* @author Scott Walkinshaw <scott.walkinshaw@gmail.com>
*/
function roots_root_relative_url($input) {
$parsed_url = parse_url(site_url());
$site_domain = $parsed_url['host'];
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);
} else {
return $input;

View File

@@ -30,7 +30,7 @@ if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }
// Define helper constants
$get_theme_name = explode('/themes/', get_template_directory());
define('THEME_NAME', next($get_theme_name));
define('RELATIVE_PLUGIN_PATH', str_replace(home_url() . '/', '', plugins_url()));
define('RELATIVE_CONTENT_PATH', str_replace(home_url() . '/', '', content_url()));
define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);
define('THEME_NAME', next($get_theme_name));
define('RELATIVE_PLUGIN_PATH', str_replace(home_url() . '/', '', plugins_url()));
define('RELATIVE_CONTENT_PATH', str_replace(home_url() . '/', '', content_url()));
define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);