From 59e0c4da128e012837f5272d3cfe146d50e40a83 Mon Sep 17 00:00:00 2001
From: Ultimate Member
Date: Thu, 31 Dec 2015 16:49:50 +0200
Subject: [PATCH] Trim long strings in field labels (backend only)
---
admin/core/um-admin-actions-modal.php | 4 ++--
core/um-short-functions.php | 7 +++++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/admin/core/um-admin-actions-modal.php b/admin/core/um-admin-actions-modal.php
index 2123f4a7..9a309811 100644
--- a/admin/core/um-admin-actions-modal.php
+++ b/admin/core/um-admin-actions-modal.php
@@ -167,7 +167,7 @@
if ( !isset( $array['account_only'] ) && !isset( $array['private_use'] ) ) {
?>
-
+
' . __('None','ultimatemember') . '
'; } ?>
@@ -182,7 +182,7 @@
?>
-
+
' . __('You did not create any custom fields', 'ultimatemember') . ''; } ?>
diff --git a/core/um-short-functions.php b/core/um-short-functions.php
index b4122214..8c1d4c0b 100644
--- a/core/um-short-functions.php
+++ b/core/um-short-functions.php
@@ -35,6 +35,13 @@
wp_mail( $email, $subject_line, $message, $headers, $attachments );
}
+ /***
+ *** @Trim string by char length
+ ***/
+ function um_trim_string( $s, $length = 20 ) {
+ $s = strlen($s) > $length ? substr($s,0,$length)."..." : $s;
+ return $s;
+ }
/***
*** @Convert urls to clickable links
***/