WooCommerce Code Reference

Init
in package

Contains logic for the Navigation

Table of Contents

TOGGLE_OPTION_NAME  = 'woocommerce_navigation_enabled'
Option name used to toggle this feature.
$is_updated  : bool
Determines if the feature has been toggled on or off.
__construct()  : mixed
Hook into WooCommerce.
add_feature_toggle()  : array<string|int, mixed>
Add the feature toggle to the features settings.
is_nav_compatible()  : mixed
Determine if sufficient versions are present to support Navigation feature
maybe_enqueue_opt_out_scripts()  : mixed
Enqueue the opt out scripts.
maybe_reload_page()  : mixed
Reload the page if the setting has been updated.
reload_page_on_toggle()  : mixed
Reloads the page when the option is toggled to make sure all nav features are loaded.

Constants

Properties

Methods

add_feature_toggle()

Add the feature toggle to the features settings.

public static add_feature_toggle(array<string|int, mixed> $features) : array<string|int, mixed>
Parameters
$features : array<string|int, mixed>

Feature sections.

Tags
deprecated
7.0

The WooCommerce Admin features are now handled by the WooCommerce features engine (see the FeaturesController class).

Return values
array<string|int, mixed>

is_nav_compatible()

Determine if sufficient versions are present to support Navigation feature

public is_nav_compatible() : mixed
Return values
mixed

reload_page_on_toggle()

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

public static reload_page_on_toggle(string $old_value, string $value) : mixed
Parameters
$old_value : string

Old value.

$value : string

New value.

Return values
mixed