Merge branch 'master' into grunt

This commit is contained in:
Ben Word
2013-05-08 20:32:28 -05:00
4 changed files with 20 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
### HEAD
* Fix relative external URLs issue
### 6.4.0: May 1st, 2013 ### 6.4.0: May 1st, 2013
* Fix Theme Activation page issues * Fix Theme Activation page issues
* Fix issues with root relative URLs and rewrites on non-standard setups * Fix issues with root relative URLs and rewrites on non-standard setups

View File

@@ -190,7 +190,11 @@ function roots_theme_activation_action() {
$roots_theme_activation_options['change_uploads_folder'] = false; $roots_theme_activation_options['change_uploads_folder'] = false;
update_option('uploads_use_yearmonth_folders', 0); update_option('uploads_use_yearmonth_folders', 0);
update_option('upload_path', 'assets'); if (!is_multisite()) {
update_option('upload_path', 'assets');
} else {
update_option('upload_path', '');
}
} }
if ($roots_theme_activation_options['create_navigation_menus'] === 'true') { if ($roots_theme_activation_options['create_navigation_menus'] === 'true') {

View File

@@ -138,8 +138,16 @@ 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) {
$output = wp_make_link_relative($input); $parsed_url = parse_url(site_url());
return $output; $site_domain = $parsed_url['host'];
preg_match('|https?://([^/]+)(/.*)|i', $input, $matches);
if (isset($matches[1]) && isset($matches[2]) && $matches[1] === $site_domain) {
return wp_make_link_relative($input);
} else {
return $input;
}
} }
function roots_enable_root_relative_urls() { function roots_enable_root_relative_urls() {
@@ -152,7 +160,7 @@ if (roots_enable_root_relative_urls()) {
'the_permalink', 'the_permalink',
'wp_list_pages', 'wp_list_pages',
'wp_list_categories', 'wp_list_categories',
'wp_nav_menu', 'roots_wp_nav_menu_item',
'the_content_more_link', 'the_content_more_link',
'the_tags', 'the_tags',
'get_pagenum_link', 'get_pagenum_link',

View File

@@ -34,6 +34,7 @@ class Roots_Nav_Walker extends Walker_Nav_Menu {
$item_html = preg_replace('/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html); $item_html = preg_replace('/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html);
} }
$item_html = apply_filters('roots_wp_nav_menu_item', $item_html);
$output .= $item_html; $output .= $item_html;
} }