Automattic\WooCommerce\Internal\Admin
SiteHealth::has_outdated_template_overrides
Determine whether the active theme has outdated WooCommerce template overrides.
Метод класса: SiteHealth{}
Хуков нет.
Возвращает
true|false.
Использование
// private - только в коде основоного (родительского) класса $result = $this->has_outdated_template_overrides();
Код SiteHealth::has_outdated_template_overrides() SiteHealth::has outdated template overrides WC 11.0.1
private function has_outdated_template_overrides() {
$core_templates = WC_Admin_Status::scan_template_files( WC()->plugin_path() . '/templates' );
foreach ( $core_templates as $file ) {
$theme_file = $this->get_theme_template_override_path( $file );
if ( ! $theme_file ) {
continue;
}
$core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $file );
$theme_version = WC_Admin_Status::get_file_version( $theme_file );
if ( $core_version && $theme_version && version_compare( $theme_version, $core_version, '<' ) ) {
return true;
}
}
return false;
}