wpcf7_cleanup_captcha_files()
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
wpcf7_cleanup_captcha_files();
Код wpcf7_cleanup_captcha_files() wpcf7 cleanup captcha files CF7 6.0.6
function wpcf7_cleanup_captcha_files() { if ( ! $captcha = wpcf7_init_captcha() ) { return false; } if ( is_callable( array( $captcha, 'cleanup' ) ) ) { return $captcha->cleanup(); } $dir = trailingslashit( wpcf7_captcha_tmp_dir() ); if ( ! is_dir( $dir ) or ! is_readable( $dir ) or ! wp_is_writable( $dir ) ) { return false; } if ( $handle = opendir( $dir ) ) { while ( false !== ( $file = readdir( $handle ) ) ) { if ( ! preg_match( '/^[0-9]+\.(php|txt|png|gif|jpeg)$/', $file ) ) { continue; } $stat = stat( path_join( $dir, $file ) ); if ( $stat['mtime'] + HOUR_IN_SECONDS < time() ) { @unlink( path_join( $dir, $file ) ); } } closedir( $handle ); } }