Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Admin_Page_Status::remove_log_file()

Delete a log file


Return Return

(void)


Top ↑

Source Source

File: includes/admin/class.llms.admin.page.status.php

	private static function remove_log_file() {

		if ( ! llms_verify_nonce( '_wpnonce', 'delete_log', 'GET' ) || ! current_user_can( 'manage_lifterlms' ) ) {
			wp_die( __( 'Action failed. Please refresh the page and retry.', 'lifterlms' ) );
		}

		if ( ! empty( $_REQUEST['llms_delete_log'] ) ) {

			$logs   = self::get_logs();
			$handle = sanitize_title( wp_unslash( $_REQUEST['llms_delete_log'] ) );
			$log    = isset( $logs[ $handle ] ) ? $logs[ $handle ] : false;

			if ( $log && is_file( $log ) && is_writable( $log ) ) {
				unlink( $log );
				llms_redirect_and_exit( esc_url_raw( self::get_url( 'logs' ) ) );
			}
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.37.14 Added user capability check.
3.35.0 Sanitize input data.
3.11.2 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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