Documentation

Navigation
in package

Navigation Module class.

Table of Contents

Properties

$action_hook  : ActionHook
ActionHook instance.
$description  : string
Navigation description.
$location  : string
Navigation location.
$register_menu  : bool
Whether to register the navigation menu.

Methods

__construct()  : mixed
Constructor.
__toString()  : string
Custom toString magic method.
register_nav_menu()  : mixed
Registers the navigation with WordPress.
initialize()  : void
Initializes the navigation.

Properties

$action_hook

ActionHook instance.

private ActionHook $action_hook

ActionHook object for the register_nav_menu method.

Tags
since
1.0.0

$register_menu

Whether to register the navigation menu.

private bool $register_menu

Whether to register the navigation menu.

Tags
since
1.0.0

Methods

__construct()

Constructor.

public __construct(string $location, string $description[, ActionHook $action_hook = null ][, bool $register_menu = true ]) : mixed

Constructs the Navigation object by setting the location, description, and action hook.

Parameters
$location : string

Navigation location.

$description : string

Navigation description.

$action_hook : ActionHook = null

Optional. ActionHook instance. Default 'init'.

$register_menu : bool = true

Optional. Whether to register the navigation menu. Default true.

Tags
since
1.0.0

__toString()

Custom toString magic method.

public __toString() : string

Returns the navigation as a JSON string.

Tags
since
1.0.0
Return values
string

JSON string.

initialize()

Initializes the navigation.

private initialize() : void

Hooks the action to register the navigation and adds the navigation to the registry.

Tags
since
1.0.0

        
On this page

Search results