abstract class Page extends Singleton

A class to abstract and automate the process of building Pages.

Properties

static protected Singleton[] $_instances from  Singleton

Methods

__construct()

Add action for creating submenu page.

static Singleton
instance(mixed $args = null)

Maybe initialize singleton instance and return the instance.

static array
get_instances()

Return a copy of the instances array.

get_class_reflection()

A short one-liner tool to get a ReflectionClass so we can get runtime info for the static class instance and not this abstract.

static 
add_menu_item()

The function which will be called to add the page to the menu.

static string
page_option_group()

The page slug for registering settings, adding menu items, etc.

static string
page_title()

The page name/title for display.

static string
menu_title()

The menu name/title for display.

static string
page_capability()

The capability required for the page to be displayed to the user.

static string
submenu_id()

Return the submenu ID for use with the WordPress $submenu global.

static Settings_Section[]
get_sections()

Return the Sections associated with this Settings Page.

static bool
menu_item_exists()

See if the Settings Page exists in the WP global $submenu.

Details

at line 78
protected __construct()

Add action for creating submenu page.

in Singleton at line 42
final static Singleton instance(mixed $args = null)

Maybe initialize singleton instance and return the instance.

Parameters

mixed $args

The arguments to pass to the singleton constructor if constructing.

Return Value

Singleton

This instance.

in Singleton at line 63
final static array get_instances()

Return a copy of the instances array.

Return Value

array

A list of Singleton instances that have been instantiated.

in Singleton at line 72
final protected ReflectionClass get_class_reflection()

A short one-liner tool to get a ReflectionClass so we can get runtime info for the static class instance and not this abstract.

Return Value

ReflectionClass

The runtime instance of this class being evalutated.

at line 31
abstract static protected add_menu_item()

The function which will be called to add the page to the menu.

at line 38
abstract static string page_option_group()

The page slug for registering settings, adding menu items, etc.

Return Value

string

The page slug.

at line 45
abstract static string page_title()

The page name/title for display.

Return Value

string

The page title.

at line 52
abstract static string menu_title()

The menu name/title for display.

Return Value

string

The menu title.

at line 59
abstract static string page_capability()

The capability required for the page to be displayed to the user.

Return Value

string

The capability required to display the settings page.

at line 66
abstract static string submenu_id()

Return the submenu ID for use with the WordPress $submenu global.

Return Value

string

The ID of the submenu from the WordPress global $submenu.

at line 73
final static Settings_Section[] get_sections()

Return the Sections associated with this Settings Page.

Return Value

Settings_Section[]

The Sections of this Page.

at line 92
final static bool menu_item_exists()

See if the Settings Page exists in the WP global $submenu.

Return Value

bool

Whether or not the Page has been set.