From f975847ea159b79f28e916ffefee2cb52b2392b1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 3 May 2017 13:27:17 -0700 Subject: [PATCH] News: Meta-description character limit option added. ie. {NEWS_DESCRIPTION: limit=x} --- e107_core/shortcodes/batch/news_shortcodes.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index df9e0fa6b..a95551abb 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -1120,7 +1120,15 @@ class news_shortcodes extends e_shortcode function sc_newsmetadiz($parm=null) { - return e107::getParser()->toHtml($this->news_item['news_meta_description'],true); + $text = e107::getParser()->toHtml($this->news_item['news_meta_description'],true); + + if(!empty($parm['limit'])) + { + $text = e107::getParser()->text_truncate($text, $parm['limit']); + } + + return $text; + } }