Admin
in package
The general admin-specific functionality of the plugin.
Class for basic admin-specific functionality and helper methods.
Tags
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
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
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
Return values
array<string|int, mixed> —The updated "at a glance" items array.
add_site_logo()
Add site logo to admin page.
public
add_site_logo() : void
Tags
add_toolbar_environment_type()
Add the environment type to the admin bar menu.
public
add_toolbar_environment_type(WP_Admin_Bar $admin_bar) : void
Parameters
- $admin_bar : WP_Admin_Bar
-
The WordPress toolbar instance, passed by reference.
Tags
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
remove_footer_text()
Remove default footer.
public
remove_footer_text() : false
Tags
Return values
falserestrict_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
__construct()
Initialise the class.
protected
__construct() : void