diff --git a/includes/roots-cleanup.php b/includes/roots-cleanup.php index 5e1e2ecce7..ac70229cf4 100644 --- a/includes/roots-cleanup.php +++ b/includes/roots-cleanup.php @@ -1,5 +1,9 @@ 'wp-content/themes/'. $theme_name . '/css/$1', @@ -22,7 +26,6 @@ function roots_add_rewrites($content) { $wp_rewrite->non_wp_rules += $roots_new_non_wp_rules; } -add_action('generate_rewrite_rules', 'roots_add_rewrites'); add_action('admin_init', 'roots_flush_rewrites'); function roots_clean_assets($content) { @@ -32,8 +35,6 @@ function roots_clean_assets($content) { $content = str_replace($current_path, $new_path, $content); return $content; } -add_filter('bloginfo', 'roots_clean_assets'); -add_filter('stylesheet_directory_uri', 'roots_clean_assets'); function roots_clean_plugins($content) { $current_path = '/wp-content/plugins'; @@ -41,7 +42,14 @@ function roots_clean_plugins($content) { $content = str_replace($current_path, $new_path, $content); return $content; } -add_filter('plugins_url', 'roots_clean_plugins'); + +// only use clean urls if the theme isn't a child +if ($theme_data['Template'] === '') { + add_action('generate_rewrite_rules', 'roots_add_rewrites'); + add_filter('plugins_url', 'roots_clean_plugins'); + add_filter('bloginfo', 'roots_clean_assets'); + add_filter('stylesheet_directory_uri', 'roots_clean_assets'); +} // redirect /?s to /search/ // http://txfx.net/wordpress-plugins/nice-search/