fixes #250 - some plugins cause an error with roots h5bp rewrites

This commit is contained in:
Ben Word
2012-01-29 18:27:26 -07:00
parent 01696fde63
commit 2abc629272

View File

@@ -53,6 +53,7 @@ if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') !== false) {
if (!is_multisite() && !is_child_theme()) { if (!is_multisite() && !is_child_theme()) {
add_action('generate_rewrite_rules', 'roots_add_rewrites'); add_action('generate_rewrite_rules', 'roots_add_rewrites');
add_action('generate_rewrite_rules', 'roots_add_h5bp_htaccess'); add_action('generate_rewrite_rules', 'roots_add_h5bp_htaccess');
add_action('activate_plugin', 'roots_add_h5bp_htaccess');
if (!is_admin()) { if (!is_admin()) {
add_filter('plugins_url', 'roots_clean_plugins'); add_filter('plugins_url', 'roots_clean_plugins');
add_filter('bloginfo', 'roots_clean_assets'); add_filter('bloginfo', 'roots_clean_assets');
@@ -67,6 +68,10 @@ if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') !== false) {
function roots_add_h5bp_htaccess($content) { function roots_add_h5bp_htaccess($content) {
global $wp_rewrite; global $wp_rewrite;
if (!function_exists('get_home_path')) {
return;
}
$home_path = get_home_path(); $home_path = get_home_path();
$htaccess_file = $home_path . '.htaccess'; $htaccess_file = $home_path . '.htaccess';