WordPress at Your Fingertips
function is not described

WC_Admin_Notices::template_file_check_notice() public WC 1.0

Show a notice highlighting bad template files.

{} It's a method of the class: WC_Admin_Notices{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Admin_Notices::template_file_check_notice();

Code of WC_Admin_Notices::template_file_check_notice() WC 5.9.0

public static function template_file_check_notice() {
	$core_templates = WC_Admin_Status::scan_template_files( WC()->plugin_path() . '/templates' );
	$outdated       = false;

	foreach ( $core_templates as $file ) {

		$theme_file = false;
		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;
		}

		if ( false !== $theme_file ) {
			$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, '<' ) ) {
				$outdated = true;
				break;
			}
		}
	}

	if ( $outdated ) {
		include dirname( __FILE__ ) . '/views/html-notice-template-check.php';
	} else {
		self::remove_notice( 'template_files' );
	}
}