Plugin Directory

Admin Page Framework

Provides simpler means of building administration pages for plugin and theme developers.

Getting Started

  1. Include admin-page-framework.php that is located in the classes folder into your theme or plugin.
if ( !class_exists( 'Admin_Page_Framework' ) )
    include_once( dirname( __FILE__ ) . '/classes/admin-page-framework.php' );
  1. Extend the Library Class.
class APF_GettingStarted extends Admin_Page_Framework {
}
  1. Define the SetUp() Method.
function SetUp() {
    $this->SetRootMenu( 'Settings' );               // specifies to which parent menu to belong.
    $this->AddSubMenu(  'My First Setting Page',    // page and menu title
                        'my_first_settings_page' ); // page slug
}
  1. Define methods for hooks.
function do_my_first_settings_page() {  // do_ + pageslug    
    ?>
    <h3>Say Something</h3>
    <p>This is my first admin page!</p>
    <?php
}
  1. Instantiate the Class.
new APF_GettingStarted;

Example Code

<?php
/* Plugin Name: Admin Page Framework - Getting Started */ 

if ( !class_exists( 'Admin_Page_Framework' ) )
    include_once( dirname( __FILE__ ) . '/classes/admin-page-framework.php' );
    
class APF_GettingStarted extends Admin_Page_Framework {

    function SetUp() {
    
        $this->SetRootMenu( 'Settings' );               // specifies to which parent menu to belong.
        $this->AddSubMenu(  'My First Setting Page',    // page and menu title
                            'my_first_settings_page' ); // page slug
                            
    }

    function do_my_first_settings_page() {  // do_ + pageslug
    
        ?>
        <h3>Say Something</h3>
        <p>This is my first admin page!</p>
        <?php
        
    }
    
}
new APF_GettingStarted;

// That's it!

Requires: 3.0 or higher
Compatible up to: 3.5.1
Last Updated: 2013-4-7
Downloads: 1,111

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1