WP_Recovery_Mode_Key_Service::clean_expired_keys

Advertisement

Summery Summery

Removes expired recovery mode keys.

Syntax Syntax

WP_Recovery_Mode_Key_Service::clean_expired_keys( int $ttl )

Parameters Parameters

$ttl

(Required) Time in seconds for the keys to be valid for.

Source Source

File: wp-includes/class-wp-recovery-mode-key-service.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 );
	}

Advertisement

Changelog Changelog

Changelog
Version Description
5.2.0 Introduced.

Advertisement

Leave a Reply