WP_Recovery_Mode_Key_Service::clean_expired_keys()
Removes expired recovery mode keys.
Метод класса: WP_Recovery_Mode_Key_Service{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$WP_Recovery_Mode_Key_Service = new WP_Recovery_Mode_Key_Service(); $WP_Recovery_Mode_Key_Service->clean_expired_keys( $ttl );
- $ttl(int) (обязательный)
- Time in seconds for the keys to be valid for.
Список изменений
С версии 5.2.0 | Введена. |
Код WP_Recovery_Mode_Key_Service::clean_expired_keys() WP Recovery Mode Key Service::clean expired keys WP 6.6.2
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 ); }