pfeifferNet

Admin
in package

The general admin-specific functionality of the plugin.

Class for basic admin-specific functionality and helper methods.

Tags
since
1.0.0
since
5.5.0

Inherit standard singleton class.

since
5.11.0

Deprecated global singleton.

Table of Contents

Properties

$env_type  : string
The site environment type.
$instances  : array<string|int, object>
The array of instances of this class and sub-classes.

Methods

add_glance_environment_type()  : array<string|int, mixed>
Add the environment type to the "at a glance" widget item.
add_site_logo()  : void
Add site logo to admin page.
add_toolbar_environment_type()  : void
Add the environment type to the admin bar menu.
get_instance()  : object
Creates and/or returns the instance of this class.
remove_footer_text()  : false
Remove default footer.
restrict_access()  : void
Restrict access to the administration screens.
__construct()  : void
Initialise the class.

Properties

$env_type

The site environment type.

protected string $env_type = ''
Tags
since
5.3.0

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
5.11.0

Methods

add_glance_environment_type()

Add the environment type to the "at a glance" widget item.

public add_glance_environment_type(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>

The current "at a glance" items.

Tags
since
1.7.0
link
https://developer.wordpress.org/reference/hooks/dashboard_glance_items/
Return values
array<string|int, mixed>

The updated "at a glance" items array.

Add site logo to admin page.

public add_site_logo() : void
Tags
since
1.0.0

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
Return values
object

The instance of this class.

Remove default footer.

public remove_footer_text() : false
Tags
since
5.11.0
Return values
false

restrict_access()

Restrict access to the administration screens.

public restrict_access() : void
  • Only administrators, editors and authors will be allowed to access the admin screens,
  • All other users will be redirected to the site front page.
  • Allow access for Ajax requests since these may be initiated from the front end by non-admin users.
Tags
since
6.4.0
link
https://developer.wordpress.org/reference/hooks/admin_init/

__construct()

Initialise the class.

protected __construct() : void
Tags
since
1.0.0

        
On this page

Search results