Documentation

Sidebar
in package

Sidebar Module class.

Table of Contents

Properties

$action_hook  : ActionHook
ActionHook instance.
$args  : array<string|int, mixed>|string
Array of arguments for registering a sidebar.

Methods

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

Properties

$action_hook

ActionHook instance.

private ActionHook $action_hook

ActionHook object for the register_sidebar method.

Tags
since
1.0.0

Methods

__construct()

Constructor.

public __construct(array<string|int, mixed> $args[, ActionHook $action_hook = null ]) : mixed

Constructs the Sidebar object by setting the arguments and action hook.

Parameters
$args : array<string|int, mixed>

Array of arguments for registering a sidebar.

$action_hook : ActionHook = null

Optional. ActionHook instance. Default 'widgets_init'.

Tags
since
1.0.0

__toString()

Custom toString magic method.

public __toString() : string

Returns the sidebar as a JSON string.

Tags
since
1.0.0
Return values
string

JSON string.

initialize()

Initializes the sidebar.

private initialize() : void

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

Tags
since
1.0.0

        
On this page

Search results