WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Features\Navigation

Init::reload_page_on_toggle() public WC 1.0

Reloads the page when the option is toggled to make sure all nav features are loaded.

{} It's a method of the class: Init{}

No Hooks.

Return

null. Nothing.

Usage

$result = Init::reload_page_on_toggle( $old_value, $value );
$old_value(string) (required)
Old value.
$value(string) (required)
New value.

Code of Init::reload_page_on_toggle() WC 5.2.2

<?php
public static function reload_page_on_toggle( $old_value, $value ) {
	if ( $old_value === $value ) {
		return;
	}

	if ( 'yes' !== $value ) {
		update_option( 'woocommerce_navigation_show_opt_out', 'yes' );
	}

	if ( isset( $_SERVER['REQUEST_URI'] ) ) {
		wp_safe_redirect( wp_unslash( $_SERVER['REQUEST_URI'] ) );
		exit();
	}
}