WC_Admin_Status::scan_template_files()public staticWC 1.0

Scan the template files.

Method of the class: WC_Admin_Status{}

No Hooks.

Return

Array.

Usage

$result = WC_Admin_Status::scan_template_files( $template_path );
$template_path(string) (required)
Path to the template directory.

WC_Admin_Status::scan_template_files() code WC 8.6.1

public static function scan_template_files( $template_path ) {
	$files  = @scandir( $template_path ); // @codingStandardsIgnoreLine.
	$result = array();

	if ( ! empty( $files ) ) {

		foreach ( $files as $key => $value ) {

			if ( ! in_array( $value, array( '.', '..' ), true ) ) {

				if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) {
					$sub_files = self::scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value );
					foreach ( $sub_files as $sub_file ) {
						$result[] = $value . DIRECTORY_SEPARATOR . $sub_file;
					}
				} else {
					$result[] = $value;
				}
			}
		}
	}
	return $result;
}