Skip to content

Repository files navigation

Welcome to Admin Page Framework GitHub Repository

Admin Page Framework is an OOP based open source WordPress library that facilitates theme and plugin development.

Scrutinizer Code QualityBuild Status

Admin Page Framework - Text, Password, and Textarea

Admin Page Framework - SelectorsAdmin Page Framework - Image, Media Library, and File UploadsAdmin Page Framework - Taxonomies and Post Types ChecklistAdmin Page Framework - MiscAdmin Page Framework - Form Input VerificationAdmin Page Framework - Export and Import OptionsAdmin Page Framework - Contextual Help PaneAdmin Page Framework - Custom Post Type and Meta BoxAdmin Page Framework - Meta Boxes in Pages Added by the FrameworkAdmin Page Framework - Form Fields in Taxonomy PageAdmin Page Framework - Form Sections in Tabbed Boxes and Repeatable OptionAdmin Page Framework - Auto-complete Custom Field TypeAdmin Page Framework - Widget Form Fields

Installation

There are mainly two ways to include the framework.

  • Use the framework loader plugin.

    • The latest development version can be found here.
    • The latest stable version can be downloaded here.
  • Use the generated framework files which can be downloaded via Dashboard -> Admin Page Framework -> Tools -> Generator.

For more details, see the Getting Started (Dashboard -> Admin Page Framework -> Help -> Getting Started) of the admin pages of the loader plugin.

Examples

Create a Page

Admin Page Framework - Getting Started

<?php/* Plugin Name: Admin Page Framework - Getting Started */include( dirname( __FILE__ ) . '/library/apf/admin-page-framework.php' );
classAPFextends AdminPageFramework {
publicfunctionsetUp() {
$this->setRootMenuPage( 'Settings' ); // where to belong$this->addSubMenuItem(
array(
'title' => 'My First Page',
'page_slug' => 'myfirstpage'
)
);
}
/** * @callback action do_{page slug} */publicfunctiondo_myfirstpage() {
?>
<h3>Say Something</h3>
<p>This is my first admin page!</p>
<?php }
}
newAPF;

Create a Form

Admin Page Framework - My First Form

<?php/* Plugin Name: Admin Page Framework - My First Form */include( dirname( __FILE__ ) . '/library/apf/admin-page-framework.php' );
class APF_MyFirstFrom extends AdminPageFramework {
publicfunctionsetUp() {
$this->setRootMenuPage( 'My Settings' ); // create a root page $this->addSubMenuItem(
array(
'title' => 'My First Form',
'page_slug' => 'my_first_form'
)
);
}
/** * The pre-defined callback method that is triggered when the page loads. * @callback action load_{page slug} */publicfunctionload_my_first_form( $oAdminPage ) {
$this->addSettingSections( array(
'section_id' => 'my_first_text_section', 'page_slug' => 'my_first_form', )
);
$this->addSettingFields(
array( 'field_id' => 'text',
'section_id' => 'my_first_text_section',
'title' => 'Text',
'type' => 'text',
'default' => 123456,
),
array( 'field_id' => 'submit',
'type' => 'submit',
)
);
}
}
newAPF_MyFirstFrom;

See more code examples in Dashboard -> AdminPageFramework -> Help -> Examples.

Resources

Getting Helped

Contributions

Anyone is welcome to contribute to Admin Page Framework. There are various ways you can contribute:

Browser Compatibility

Internet Explorer 9 or below is not supported.

The framework uses

  • CSS flex.

Framework Core Development

See the contribution guideline.

Supporting Future Development

If you like the library, please rate and review it in the WordPress Plugin Directory. Also donation would be greatly appreciated. Thank you!

Donate with PayPal

Copyright and License

Admin Page Framework (Framework Files)

MIT license

Admin Page Framework - Loader (WordPress Plugin)

GPL v2

Releases

Packages

Used by

Contributors

Languages