WC_Install::needs_db_update()
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() WC Install::needs db update code WC 9.4.2
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 ), '<' ); }