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
TOGGLE_OPTION_NAME
Option name used to toggle this feature.
public
mixed
TOGGLE_OPTION_NAME
= 'woocommerce_navigation_enabled'
Properties
$is_updated
Determines if the feature has been toggled on or off.
protected
static bool
$is_updated
= false
Methods
__construct()
Hook into WooCommerce.
public
__construct() : mixed
Return values
mixed —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
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 —maybe_enqueue_opt_out_scripts()
Enqueue the opt out scripts.
public
maybe_enqueue_opt_out_scripts() : mixed
Return values
mixed —maybe_reload_page()
Reload the page if the setting has been updated.
public
static maybe_reload_page() : 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.