WordPress at a glance
function is not described

WP_Recovery_Mode_Key_Service::clean_expired_keys() public WP 5.2.0

Removes expired recovery mode keys.

{} It's a method of the class: WP_Recovery_Mode_Key_Service{}

No Hooks.

Return

Null. Nothing.

Usage

$WP_Recovery_Mode_Key_Service = new WP_Recovery_Mode_Key_Service();
$WP_Recovery_Mode_Key_Service->clean_expired_keys( $ttl );
$ttl(int) (required)
Time in seconds for the keys to be valid for.

Changelog

Since 5.2.0 Introduced.

Code of WP_Recovery_Mode_Key_Service::clean_expired_keys() WP 5.5.1

<?php
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 );
}