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.
WC_Tracker::get_all_template_overrides()
Look for any template override and return filenames.
Description Description
Return Return
(array)
Source Source
File: includes/class-wc-tracker.php
private static function get_all_template_overrides() { $override_data = array(); $template_paths = apply_filters( 'woocommerce_template_overrides_scan_paths', array( 'WooCommerce' => WC()->plugin_path() . '/templates/' ) ); $scanned_files = array(); require_once WC()->plugin_path() . '/includes/admin/class-wc-admin-status.php'; foreach ( $template_paths as $plugin_name => $template_path ) { $scanned_files[ $plugin_name ] = WC_Admin_Status::scan_template_files( $template_path ); } foreach ( $scanned_files as $plugin_name => $files ) { foreach ( $files as $file ) { if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/' . $file; } elseif ( file_exists( get_stylesheet_directory() . '/' . WC()->template_path() . $file ) ) { $theme_file = get_stylesheet_directory() . '/' . WC()->template_path() . $file; } elseif ( file_exists( get_template_directory() . '/' . $file ) ) { $theme_file = get_template_directory() . '/' . $file; } elseif ( file_exists( get_template_directory() . '/' . WC()->template_path() . $file ) ) { $theme_file = get_template_directory() . '/' . WC()->template_path() . $file; } else { $theme_file = false; } if ( false !== $theme_file ) { $override_data[] = basename( $theme_file ); } } } return $override_data; }