Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Abstract_Notification_View::sentence_case( string $string )
Convert a string to sentence case
Description Description
Useful for handling lowercased merged data like "you" which may appear at the beginning or middle of a sentence.
Parameters Parameters
- $string
-
(string) (Required) A string.
Return Return
(string)
Source Source
File: includes/abstracts/llms.abstract.notification.view.php
private function sentence_case( $string ) { $sentences = preg_split( '/(\.|\?|\!)(\s|$)+/', $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); $new_string = ''; foreach ( $sentences as $sentence ) { $new_string .= strlen( $sentence ) === 1 ? $sentence . ' ' : ucfirst( trim( $sentence ) ); } return trim( $new_string ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.8.0 | |
3.24.0 | Introduced. |