diff --git a/includes/News/News.php b/includes/News/News.php index d08ed96..e045091 100644 --- a/includes/News/News.php +++ b/includes/News/News.php @@ -56,7 +56,7 @@ public function shortcodeCustomNews($atts) { 'forcelandscape' => 'false', 'force_landscape' => 'false', 'sticky_only' => 'false', - 'teaser_length' => '0', + 'teaser_length' => '55', ], $atts); $sc_atts = array_map('sanitize_text_field', $sc_atts); @@ -306,6 +306,7 @@ function ($post_ID) { 'thumbnailSize' => $thumbnailSize, 'forceLandscape' => $forceLandscape, 'showContent' => (in_array('show_content', $mode) ? true : false), + 'teaserLength' => $teaserLength, ]; $output .= (new Columns())->shortcodeColumn([], $this->display_news_teaser($args)); } elseif (!empty($postCols)) { @@ -322,6 +323,7 @@ function ($post_ID) { 'thumbnailSize' => $thumbnailSize, 'forceLandscape' => $forceLandscape, 'showContent' => (in_array('show_content', $mode) ? true : false), + 'teaserLength' => $teaserLength, ]; $output .= do_shortcode($this->display_news_teaser($args)); } else { @@ -404,8 +406,9 @@ private function display_news_teaser($argsRaw) { 'postCols' => [], 'thumbnailSize' => 'large', 'forceLandscape'=> false, + 'teaserLength' => 20, ]; - if ($argsRaw['id'] == 0) return; + if ($argsRaw['id'] == 0) return ''; $args = wp_parse_args($argsRaw, $defaults); foreach ($args as $k => $v) { ${$k} = $v; @@ -500,7 +503,9 @@ private function display_news_teaser($argsRaw) { $abstract .= fau_create_readmore($permalink, get_the_title(), false, true); } } else { - $abstract = get_the_excerpt($id); + $excerpt = get_the_excerpt($id); + $excerpt_more = apply_filters( 'excerpt_more', '…' ); + $abstract = wp_trim_words( $excerpt, $teaserLength, $excerpt_more ); } } else { if (function_exists('fau_create_readmore')) { diff --git a/package.json b/package.json index d111f2b..36735ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rrze-elements", - "version": "1.28.2", + "version": "1.28.4", "description": "RRZE Elements: Gestalterische Erweiterungen für Webauftritte.", "main": "rrze-elements.php", "textdomain": "rrze-elements", diff --git a/rrze-elements.php b/rrze-elements.php index 6320b24..b752434 100644 --- a/rrze-elements.php +++ b/rrze-elements.php @@ -4,7 +4,7 @@ Plugin Name: RRZE Elements Plugin URI: https://github.com/RRZE-Webteam/rrze-elements Description: Advanced design elements for WordPress websites. -Version: 1.28.3 +Version: 1.28.4 Author: RRZE Webteam Author URI: https://blogs.fau.de/webworking/ License: GNU General Public License v2 @@ -23,7 +23,7 @@ const RRZE_PHP_VERSION = '7.4'; const RRZE_WP_VERSION = '5.9'; -const RRZE_ELEMENTS_VERSION = '1.28.2'; +const RRZE_ELEMENTS_VERSION = '1.28.4'; spl_autoload_register(function ($class) { $prefix = __NAMESPACE__;