I'm trying to trim data from a custom field when displaying it.
I found this, but it's not working as it should: https://toolset.com/forums/topic/strim-a-custom-field/
You can see the issue on the home page, in the reviews section -> hidden link

Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
You shared the reference ticket:
- https://toolset.com/forums/topic/strim-a-custom-field/
Have you added the custom shortcode to "Custom Code" offered by Toolset:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset
add_shortcode('trim', 'trim_shortcode');
function trim_shortcode($atts, $content = '') {
$content = do_shortcode($content);
$length = (int)$atts['length'];
if (strlen($content) > $length) {
$content = substr($content, 0, $length) . '…';
}
return $content;
}