Created
May 14, 2019 11:39
-
-
Save MjHead/812147fc2837e9420220848afaa682a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'jet-engine/listings/allowed-callbacks', 'jet_add_trim_callback', 10, 2 ); | |
| function jet_add_trim_callback( $callbacks ) { | |
| $callbacks['jet_trim_string'] = 'Trim string'; | |
| return $callbacks; | |
| } | |
| function jet_trim_string( $string ) { | |
| return mb_strimwidth( $string, 0, 20, '...' ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment