Class KB_Admin

Description

Generic Class that can be extended for creating admin screens for plugins.

Extend and initiate this class for every admin page created.

Located in /includes/kb-admin.php (line 18)


	
			
Variable Summary
 String $capability
 String $icon
 String $menu_title
 String $page_title
 String $parent
 Int $position
 Array[string]String $slug
Method Summary
 KB_Admin __construct ()
 void add_to_menu ()
 void body ()
 void body_wrapper ()
 bool current_page ()
 void help ()
 void hook_page ()
 void hook_page_title ( $admin_title,  $title)
 void init (string $hook)
 void load_resources ()
Variables
String $capability = 'read' (line 66)

Capability at which this page can be shown.

Over-ride these variables to create a new page class.

Takes care of the capability check at both the menu display as well as at the page load.

  • access: protected
String $icon (line 72)

Icon to be added in the menu.

Over-ride these variables to create a new page class.

  • access: protected
String $menu_title (line 56)

Menu title

Over-ride these variables to create a new page class. If this is set a menu entry will be created for this page instance. Otherwise no menu entry will be created.

  • access: protected
String $page_title (line 46)

Page title

Over-ride these variables to create a new page class.

  • access: protected
String $parent = 'admin.php' (line 91)

Parent Menu

Over-ride these variables to create a new page class. If not set and a menu title is provided, a top-level element is created--otherwise a submenu element is created.

  • access: protected
Int $position = 100 (line 81)

Position in the menu

Over-ride these variables to create a new page class. Used only if the menu title is provided.

  • access: protected
Array[string]String $slug (line 40)

Store slug used for the page.

Over-ride these variables to create a new page class.

  • access: protected
Methods
Constructor __construct (line 102)

The constructor, conditionally initializes the requirements for the plugin.

Instead of having to check whether the correct page has been loaded externally, this function only initializes required scripts and styles on the appropriate plugin pages.

  • access: public
KB_Admin __construct ()
add_to_menu (line 114)

Add menus and determine the hook.

  • access: public
void add_to_menu ()
body (line 233)

Extend this function to actually display the contents of the page. Should echo the data to be displayed.

  • access: public
void body ()
body_wrapper (line 219)

Output minimal boiler-plate HTML to make the page behave.

  • access: public
void body_wrapper ()
current_page (line 201)

Returns true if the current page is the one added by this class.

  • access: public
bool current_page ()
customize_screen (line 210)

Override to customize the screen--screen options, etc.

  • access: public
void customize_screen ()
help (line 214)

Override to modify the help message.

  • access: public
void help ()
hook_page (line 160)

Add a page to be loaded for the specified slug. Do not over-ride.

Only used for instances without a menu page. This code is based off the internals of add_menu_page.

  • access: public
void hook_page ()
hook_page_title (line 178)

Set the title of a page defined without any entry in the menu.

  • access: public
void hook_page_title ( $admin_title,  $title)
  • $admin_title
  • $title
init (line 142)

Wrapper for conditionally loading resources

  • access: public
void init (string $hook)
  • string $hook: hook The current hook suffix for checking before loading.
load_resources (line 206)

Override to load resources as required

  • access: public
void load_resources ()
set_current_page (line 189)

Runs only if the page corresponding to this class is called.

Also runs a security check on the caps of the user.

  • access: public
void set_current_page ()

Documentation generated on Thu, 29 Sep 2011 01:44:45 +0530 by phpDocumentor 1.4.3