Removes expired recovery mode keys.
Parameters
$ttl
intrequired- Time in seconds for the keys to be valid for.
Source
public function clean_expired_keys( $ttl ) {
$records = $this->get_keys();
foreach ( $records as $key => $record ) {
if ( ! isset( $record['created_at'] ) || time() > $record['created_at'] + $ttl ) {
unset( $records[ $key ] );
}
}
$this->update_keys( $records );
}
Changelog
Version | Description |
---|---|
5.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.