WC_Install::maybe_update_db_version
See if we need to show or run database updates during install.
Method of the class: WC_Install{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Install::maybe_update_db_version();
Changelog
| Since 3.2.0 | Introduced. |
WC_Install::maybe_update_db_version() WC Install::maybe update db version code WC 10.3.6
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 ( self::is_db_auto_update_enabled() ) {
wc_get_logger()->info( 'Automatic database update triggered.', array( 'source' => 'wc-updater' ) );
self::update();
} else {
self::add_update_db_notice();
}
} else {
self::update_db_version();
}
}