source/php/Options.php
public function register($pageTitle, $menuTitle, $capability, $menuSlug, $iconUrl = null, $position = null, $parent = 'modularity')
    {
        add_action('admin_menu', function () use ($pageTitle, $menuTitle, $capability, $menuSlug, $iconUrl, $position, $parent) {
            // Add the menu page
            $this->screenHook = add_submenu_page(
                $parent,
                $pageTitle,
                $menuTitle,
                $capability,
                $menuSlug,
                array($this, 'optionPageTemplate')
            );

            // Set the slug
            $this->slug = $menuSlug;

            // Setup meta box support
            add_action('load-' . $this->screenHook, array($this, 'save'), 1);
            add_action('load-' . $this->screenHook, array($this, 'setupMetaBoxSupport'), 2);

            // Hook to add the metaboxes
            add_action('add_meta_boxes_' . $this->screenHook, array($this, 'addMetaBoxes'));
        });
    }
public function register($pageTitle, $menuTitle, $capability, $menuSlug, $iconUrl = null, $position = null, $parent = 'modularity')
    {
        add_action('admin_menu', function () use ($pageTitle, $menuTitle, $capability, $menuSlug, $iconUrl, $position, $parent) {
            // Add the menu page
            $this->screenHook = add_submenu_page(
                $parent,
                $pageTitle,
                $menuTitle,
                $capability,
                $menuSlug,
                array($this, 'optionPageTemplate')
            );

            // Set the slug
            $this->slug = $menuSlug;

            // Setup meta box support
            add_action('load-' . $this->screenHook, array($this, 'save'), 1);
            add_action('load-' . $this->screenHook, array($this, 'setupMetaBoxSupport'), 2);

            // Hook to add the metaboxes
            add_action('add_meta_boxes_' . $this->screenHook, array($this, 'addMetaBoxes'));
        });
    }
public function register ( $ pageTitle , $ menuTitle , $ capability , $ menuSlug , $ iconUrl = null , $ position = null , $ parent = 'modularity' ) { add_action ( 'admin_menu' , function ( ) use ( $ pageTitle , $ menuTitle , $ capability , $ menuSlug , $ iconUrl , $ position , $ parent ) { // Add the menu page $ this -> screenHook = add_submenu_page ( $ parent , $ pageTitle , $ menuTitle , $ capability , $ menuSlug , array ( $ this , 'optionPageTemplate' ) ) ; // Set the slug $ this -> slug = $ menuSlug ; // Setup meta box support add_action ( 'load-' . $ this -> screenHook , array ( $ this , 'save' ) , 1 ) ; add_action ( 'load-' . $ this -> screenHook , array ( $ this , 'setupMetaBoxSupport' ) , 2 ) ; // Hook to add the metaboxes add_action ( 'add_meta_boxes_' . $ this -> screenHook , array ( $ this , 'addMetaBoxes' ) ) ; } ) ; }
Registers an options page
@param  string      $pageTitle  Page title
@param  string      $menuTitle  Menu title
@param  string      $capability Capability needed
@param  string      $menuSlug   Menu slug
@param  strin/array $function   Callback function for content
@param  string      $iconUrl    Menu icon
@param  integer     $position   Menu position
@return void
Registers an options page