bbp_past_edit_lock( string $post_date_gmt )
Check the date against the _bbp_edit_lock setting.
Description
Parameters
- $post_date_gmt
-
(string) (Required)
Return
(bool)
Source
File: bp-forums/common/functions.php
function bbp_past_edit_lock( $post_date_gmt ) { // Assume editing is allowed $retval = false; // Bail if empty date if ( ! empty( $post_date_gmt ) ) { // Period of time $lockable = '+' . get_option( '_bbp_edit_lock', '5' ) . ' minutes'; // Now $cur_time = current_time( 'timestamp', true ); // Add lockable time to post time $lock_time = strtotime( $lockable, strtotime( $post_date_gmt ) ); // Compare if ( $cur_time >= $lock_time ) { $retval = true; } } return apply_filters( 'bbp_past_edit_lock', (bool) $retval, $cur_time, $lock_time, $post_date_gmt ); }
Changelog
Version | Description |
---|---|
bbPress (r3133) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.