llms_cleanup_tmp()
Cron function to cleanup files in the LLMS_TMP_DIR
Description Description
Removes any files that are more than a day old.
Return Return
(void)
Source Source
File: includes/llms.functions.core.php
*/
function llms_cleanup_tmp() {
$max_age = llms_current_time( 'timestamp' ) - apply_filters( 'llms_tmpfile_max_age', DAY_IN_SECONDS );
$exclude = array( '.htaccess', 'index.html' );
foreach ( glob( LLMS_TMP_DIR . '*' ) as $file ) {
// Don't cleanup index and .htaccess.
if ( in_array( basename( $file ), $exclude, true ) ) {
continue;
}
if ( filemtime( $file ) < $max_age ) {
wp_delete_file( $file );
}
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.10.1 | Use strict type comparisons. |
| 3.18.0 | Introduced. |