llms_trim_string( string $string, int $chars = 200, string $suffix = '...' )
Trim a string and append a suffix
Parameters Parameters
- $string
-
(string) (Required) Input string.
- $chars
-
(int) (Optional) Max number of characters. Default is 200.
Default value: 200
- $suffix
-
(string) (Optional) A suffix to append. Default is '...'.
Default value: '...'
Return Return
(string)
Source Source
File: includes/llms.functions.core.php
* @since 6.0.0 * @since 7.0.0 Added `llms-` and `lifterlms-` as additional default prefixes to strip. * * @param string $string String to modify. * @param string[] $prefixes List of prefixs. * @return string The modified string. If no prefixes were found, the original string is returned without modification. */ function llms_strip_prefixes( $string, $prefixes = array() ) { $prefixes = empty( $prefixes ) ? array( 'llms_', 'lifterlms_', 'llms-', 'lifterlms-' ) : $prefixes;
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |