Admin Page Framework is an open source library for WordPress consisting of a set of PHP classes that provides theme and plugin developers with simpler means of creating administration pages of WordPress.
The distribution package includes the demo plugin which uses the framework and is ready to be installed as a WordPress plugin. Just upload the unpacked folder to the ...\wp-content\plugins
folder then activate it. The sample pages will be created.
<?php
/* Plugin Name: Admin Page Framework - Getting Started */
if ( ! class_exists( 'AdminPageFramework' ) ) {
include_once( dirname( __FILE__ ) . '/library/admin-page-framework.min.php' );
}
class APF extends AdminPageFramework {
public function setUp() {
$this->setRootMenuPage( 'Settings' ); // where to belong
$this->addSubMenuItem(
array(
'title' => 'My First Page',
'page_slug' => 'myfirstpage'
)
);
}
public function do_myfirstpage() { // do_{page slug}
?>
<h3>Say Something</h3>
<p>This is my first admin page!</p>
<?php
}
}
new APF;
<?php
/* Plugin Name: Admin Page Framework - My First Form */
if ( ! class_exists( 'AdminPageFramework' ) ) {
include_once( dirname( __FILE__ ) . '/library/admin-page-framework.min.php' );
}
class APF_MyFirstFrom extends AdminPageFramework {
public function setUp() {
$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.
*/
public function load_my_first_form( $oAdminPage ) { // load_{page slug}
$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',
)
);
}
}
new APF_MyFirstFrom;
The documentation is already included in the demo plugin and it is likely up-to-date than the online version. Navigate from the sidebar menu of the admin panel, Dashboard
> Admin Page Framework
> Documentation
.
If you find an issue, let us know here!
This is a developer's portal for Admin Page Framework and should not be used for support. Please visit the support forums.
Anyone is welcome to contribute to Admin Page Framework. There are various ways you can contribute:
- Try the open beta version and report issues you encounter.
- Post ideas on enhancements.
- Raise an Issue on GitHub.
- Send us a Pull Request with your bug fixes and/or new features.
- Write a custom field type.
- Improve the documentation.
- Tweak the styling of the framework by modifying the CSS rules.
- Translate the language files in the language directory.
If you like the library, please rate and review it in the WordPress Plugin Directory. Also donation would be greatly appreciated. Thank you!
Released under the MIT license. Copyright © 2014 Michael Uno
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
http://opensource.org/licenses/MIT
Released under the GPL v2 or later. Copyright © 2014 Michael Uno
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.