WC_Install::maybe_update_db_version()private staticWC 3.2.0

See if we need to show or run database updates during install.

Method of the class: WC_Install{}

Hooks from the method

Return

null. Nothing (null).

Usage

$result = WC_Install::maybe_update_db_version();

Changelog

Since 3.2.0 Introduced.

WC_Install::maybe_update_db_version() code WC 9.4.2

private static function maybe_update_db_version() {
	if ( self::needs_db_update() ) {
		/**
		 * Allow WooCommerce to auto-update without prompting the user.
		 *
		 * @since 3.2.0
		 */
		if ( apply_filters( 'woocommerce_enable_auto_update_db', false ) ) {
			self::update();
		} else {
			WC_Admin_Notices::add_notice( 'update', true );
		}
	} else {
		self::update_db_version();
	}
}