Snippets: Trim Post Types Grid Title

This sample snippet shows you how to trim the Post Types Grid title to reduce the title to a specific number of words.

add_filter( 'vcex_shortcode_loop_atts', function( $atts ) {
	$atts[ 'post_title' ] = wp_trim_words( $atts[ 'post_title' ], 5, '…' );
	return $atts;
} );