llms_cleanup_tmp()

Cron function to cleanup files in the LLMS_TMP_DIR Removes any files that are more than a day old


Description Description


Return Return

(void)


Top ↑

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 ) {

		// dont cleanup index and .htaccess
		if ( in_array( basename( $file ), $exclude ) ) {
			continue;
		}

		if ( filemtime( $file ) < $max_age ) {
			wp_delete_file( $file );
		}
	}

}

Top ↑

Changelog Changelog

Changelog
Version Description
3.18.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.





Permalink: