Tools
in package
Defines the admin page for pfeifferNet tools.
- This page will contain the individual tools for managing pfeifferNet sites.
Tags
Table of Contents
Constants
- CAPABILITY = 'edit_others_posts'
- The user capability required to see the tools menu item.
- PAGE_SLUG = 'pnet-tools'
- The tools menu page slug.
- TOOLS_CONTAINER = 'tools.php'
- Tools container partial.
Properties
- $default_tabs : array<string|int, mixed>
- The set of default tabs to show on tools page.
- $http_handler : HTTP_Handler
- The instance of the HTTP_Handler class.
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
- $page_hook : string
- The page hook.
- $progress_container : string
- The progress indicator container markup.
- $tools_container : string
- Fully qualified path to the tools container partial.
Methods
- add_tools_menu() : void
- Add entry to tools menu.
- get_instance() : object
- Creates and/or returns the instance of this class.
- render() : void
- Render the tools page.
- __construct() : void
- Initialise the class.
- enqueue_assets() : void
- Enqueue the CSS and JavaScript for the tools.
- get_inline_script() : string
- Get the inline javascript.
Constants
CAPABILITY
The user capability required to see the tools menu item.
protected
string
CAPABILITY
= 'edit_others_posts'
Tags
PAGE_SLUG
The tools menu page slug.
protected
string
PAGE_SLUG
= 'pnet-tools'
Tags
TOOLS_CONTAINER
Tools container partial.
protected
string
TOOLS_CONTAINER
= 'tools.php'
Tags
Properties
$default_tabs
The set of default tabs to show on tools page.
protected
array<string|int, mixed>
$default_tabs
= array()
- These are key-value pairs.
- The key is the tab slug. The value is the display name for the tab.
Tags
$http_handler
The instance of the HTTP_Handler class.
protected
HTTP_Handler
$http_handler
.
Tags
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
$page_hook
The page hook.
protected
string
$page_hook
= ''
Tags
$progress_container
The progress indicator container markup.
protected
string
$progress_container
= ''
Tags
$tools_container
Fully qualified path to the tools container partial.
protected
string
$tools_container
= ''
Tags
Methods
add_tools_menu()
Add entry to tools menu.
public
add_tools_menu() : void
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.
render()
Render the tools page.
public
render() : void
- Enqueue javascript.
- Set variables for the partial.
Tags
__construct()
Initialise the class.
protected
__construct() : void
Tags
enqueue_assets()
Enqueue the CSS and JavaScript for the tools.
protected
enqueue_assets() : void
Tags
get_inline_script()
Get the inline javascript.
protected
get_inline_script() : string
Tags
Return values
string —The inline javascript.