summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index e479c28b7..817e6d71c 100644
--- a/functions.php
+++ b/functions.php
@@ -701,4 +701,12 @@
initialize_user_prefs($link, 1);
}
}
+
+ function truncate_string($str, $max_len) {
+ if (strlen($str) > $max_len) {
+ return substr($str, 0, $max_len) . "...";
+ } else {
+ return $str;
+ }
+ }
?>