WC_Install::needs_db_update()public staticWC 3.2.0

Is a DB update needed?

Method of the class: WC_Install{}

No Hooks.

Return

true|false.

Usage

$result = WC_Install::needs_db_update();

Changelog

Since 3.2.0 Introduced.

WC_Install::needs_db_update() code WC 8.7.0

public static function needs_db_update() {
	$current_db_version = get_option( 'woocommerce_db_version', null );
	$updates            = self::get_db_update_callbacks();
	$update_versions    = array_keys( $updates );
	usort( $update_versions, 'version_compare' );

	return ! is_null( $current_db_version ) && version_compare( $current_db_version, end( $update_versions ), '<' );
}