From e83cd008f397f179ba60d03c7b13689ce3c55e2d Mon Sep 17 00:00:00 2001 From: Ben Word Date: Thu, 17 May 2012 22:36:14 -0600 Subject: [PATCH] More cleanup clean up --- inc/cleanup.php | 245 +++++++++++++++++++++++++++++------------------- 1 file changed, 150 insertions(+), 95 deletions(-) diff --git a/inc/cleanup.php b/inc/cleanup.php index b0084d3..708cbf0 100644 --- a/inc/cleanup.php +++ b/inc/cleanup.php @@ -1,16 +1,22 @@ + */ function roots_root_relative_url($input) { $output = preg_replace_callback( '!(https?://[^/|"]+)([^"]+)?!', create_function( '$matches', - // if full URL is home_url("/"), return a slash for relative root + // If full URL is home_url("/"), return a slash for relative root 'if (isset($matches[0]) && $matches[0] === home_url("/")) { return "/";' . - // if domain is equal to home_url("/"), then make URL relative + // If domain is equal to home_url("/"), then make URL relative '} elseif (isset($matches[0]) && strpos($matches[0], home_url("/")) !== false) { return $matches[2];' . - // if domain is not equal to home_url("/"), do not make external link relative + // If domain is not equal to home_url("/"), do not make external link relative '} else { return $matches[0]; };' ), $input @@ -56,8 +74,10 @@ function roots_root_relative_url($input) { return $output; } -// Terrible workaround to remove the duplicate subfolder in the src of JS/CSS tags -// Example: /subfolder/subfolder/css/style.css +/** + * Terrible workaround to remove the duplicate subfolder in the src of