bbp_format_revision_reason( string $reason = '' )
Formats the reason for editing the topic/reply.
Description Description
Does these things:
- Trimming
- Removing periods from the end of the string
- Trimming again
Parameters Parameters
- $reason
-
(Optional) User submitted reason for editing.
Default value: ''
Return Return
(string) Status of topic
Source Source
File: includes/common/formatting.php
function bbp_format_revision_reason( $reason = '' ) { $reason = (string) $reason; // Bail if reason is empty if ( empty( $reason ) ) { return $reason; } // Trimming $reason = trim( $reason ); // We add our own full stop. while ( substr( $reason, -1 ) === '.' ) { $reason = substr( $reason, 0, -1 ); } // Trim again $reason = trim( $reason ); return $reason; }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |