WC_Admin_Notices::update_notice()public staticWC 1.0

If we need to update the database, include a message with the DB update button.

Method of the class: WC_Admin_Notices{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Admin_Notices::update_notice();

WC_Admin_Notices::update_notice() code WC 8.9.0

public static function update_notice() {
	$screen    = get_current_screen();
	$screen_id = $screen ? $screen->id : '';
	if ( WC()->is_wc_admin_active() && in_array( $screen_id, wc_get_screen_ids(), true ) ) {
		return;
	}

	if ( WC_Install::needs_db_update() ) {
		$next_scheduled_date = WC()->queue()->get_next( 'woocommerce_run_update_callback', null, 'woocommerce-db-updates' );

            // phpcs:ignore WordPress.Security.NonceVerification.Recommended
		if ( $next_scheduled_date || ! empty( $_GET['do_update_woocommerce'] ) ) {
			include __DIR__ . '/views/html-notice-updating.php';
		} else {
			include __DIR__ . '/views/html-notice-update.php';
		}
	} else {
		include __DIR__ . '/views/html-notice-updated.php';
	}
}