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.

Astra_Flush_Local_Fonts::delete_fonts_folder( string $folder )

Recursively delete the fonts folder.


Description


Parameters

$folder

(string) (Required) Folder path to delete.


Return

(void)


Source

File: inc/abilities/admin/settings/performance/class-astra-flush-local-fonts.php

	private function delete_fonts_folder( $folder ) {
		if ( ! is_dir( $folder ) ) {
			return;
		}

		$files = array_diff( scandir( $folder ), array( '.', '..' ) );

		foreach ( $files as $file ) {
			$path = $folder . $file;
			if ( is_dir( $path ) ) {
				$this->delete_fonts_folder( $path . '/' );
			} else {
				wp_delete_file( $path );
			}
		}

		rmdir( $folder );
	}


User Contributed Notes

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