WC_Admin_Status::scan_template_files
Scan the template files.
Метод класса: WC_Admin_Status{}
Хуков нет.
Возвращает
Массив.
Использование
$result = WC_Admin_Status::scan_template_files( $template_path );
- $template_path(строка) (обязательный)
- Path to the template directory.
Код WC_Admin_Status::scan_template_files() WC Admin Status::scan template files WC 10.7.0
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;
}