move version check into loop

This commit is contained in:
Manos Psychogyiopoulos 2015-09-30 11:01:25 +03:00
parent e36c5ae630
commit 37b24ae525
1 changed files with 4 additions and 5 deletions

View File

@ -661,11 +661,10 @@ if ( ! defined( 'ABSPATH' ) ) {
$outdated_templates = false;
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 ) {
$scanned_files = WC_Admin_Status::scan_template_files( $template_path );
foreach ( $scanned_files as $file ) {
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
$theme_file = get_stylesheet_directory() . '/' . $file;
} elseif ( file_exists( get_stylesheet_directory() . '/woocommerce/' . $file ) ) {
@ -679,7 +678,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
if ( ! empty( $theme_file ) ) {
$core_version = WC_Admin_Status::get_file_version( $template_path . $file );
$core_version = WC_Admin_Status::get_file_version( $template_path . $file ); error_log( $core_version );
$theme_version = WC_Admin_Status::get_file_version( $theme_file );
if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) {