summaryrefslogtreecommitdiffstats
path: root/wp-includes/formatting.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/formatting.php')
-rw-r--r--wp-includes/formatting.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index d153fb9..11f0067 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -1070,4 +1070,11 @@ function js_escape($text) {
return preg_replace("/\r?\n/", "\\n", addslashes($text));
}
+function wp_make_link_relative( $link, $base = '' ) {
+ if ( !$base )
+ $base = get_option( 'home' );
+ if ( 0 === strpos($link, $base) )
+ $link = substr_replace($link, '', 0, strlen($base));
+ return $link;
+}
?>