WP_Recovery_Mode_Key_Service::clean_expired_keys() WordPress Method

The WP_Recovery_Mode_Key_Service::clean_expired_keys() method is used to remove expired keys from the WordPress database. This is a cleanup routine that is automatically run by the WordPress recovery mode key service.

WP_Recovery_Mode_Key_Service::clean_expired_keys( int $ttl ) #

Removes expired recovery mode keys.


Parameters

$ttl

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


Top ↑

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


Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.