WC_Admin_Status::scan_template_files()
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() WC Admin Status::scan template files code WC 9.7.1
public static function scan_template_files( $template_path ) { $files = is_string( $template_path ) ? @scandir( $template_path ) : array(); // @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; }