# [Admin Page Framework](http://wordpress.org/plugins/admin-page-framework/) # ### Welcome to our GitHub Repository 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. ## Screenshots ##
## Installation ## - The latest development version can be found [here](https://github.com/michaeluno/admin-page-framework/branches). - The latest stable version can be downloaded [here](http://downloads.wordpress.org/plugin/admin-page-framework.latest-stable.zip). 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. ## Example ## ### Create a Page ```PHP setRootMenuPage( 'Settings' ); // where to belong $this->addSubMenuItem( array( 'title' => 'My First Page', 'page_slug' => 'myfirstpage' ) ); } public function do_myfirstpage() { // do_{page slug} ?>This is my first admin page!
```PHP
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;
```
## Documentation ##
[Online documentation](http://admin-page-framework.michaeluno.jp/en/v3/)
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`.
### Tutorials ###
[Online tutorials](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/)
1. [Create an Admin Page](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/01-create-an-admin-page/)
2. [Create a Form](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/02-create-a-form/)
3. [Create a Page Group](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/03-create-a-page-group/)
4. [Create In-page Tabs](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/04-create-inpage-tabs/)
5. [Organize a Form with Sections](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/05-organize-a-form-with-sections/)
6. [Use Section Tabs and Repeatable Sections](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/06-use-section-tabs-and-repeatable-sections/)
7. [Validate Submitted Form Data of a Single Field](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/07-validate-submitted-form-data-of-a-single-field/)
8. [Validate Submitted Form Data of Multiple Fields](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/08-validate-submitted-form-data-of-multiple-fields/)
9. [Add a Meta Box in an Admin Page](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/09-add-a-meta-box-in-an-admin-page/)
10. [Add a Page Meta Box Specific to an In-page Tab](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/10-add-a-page-meta-box-specific-to-an-in-page-tab/)
11. [Add a Meta Box for Posts](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/11-add-a-meta-box-for-posts/)
12. [Create a Custom Post Type and Custom Taxonomy](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/12-create-a-custom-post-type-and-custom-taxonomy/)
13. [Add a Meta Box to a Custom Post Type](http://en.michaeluno.jp/admin-page-framework/tutorials-v3/13-add-a-meta-box-for-a-custom-post-type/)
## Bugs ##
If you find an issue, let us know [here](https://github.com/michaeluno/admin-page-framework/issues)!
## Support ##
This is a developer's portal for Admin Page Framework and should _not_ be used for support. Please visit the [support forums](http://wordpress.org/support/plugin/admin-page-framework).
## Contributions ##
Anyone is welcome to contribute to Admin Page Framework. There are various ways you can contribute:
- Try the open [beta version](https://github.com/michaeluno/admin-page-framework/labels/Beta%20Stage) and report issues you encounter.
- Post ideas on [enhancements](https://github.com/michaeluno/admin-page-framework/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open).
- Raise an [Issue](https://github.com/michaeluno/admin-page-framework/issues) on GitHub.
- Send us a Pull Request with your bug fixes and/or new features.
- Write a [custom field type](http://admin-page-framework.michaeluno.jp/en/v3/package-AdminPageFramework.FieldType.html).
- Write [test cases](test/readme.md).
- Improve the [documentation](https://github.com/michaeluno/admin-page-framework/blob/master/documentation_guideline.md).
- Tweak the styling of the framework by modifying the [CSS rules](https://github.com/michaeluno/admin-page-framework/blob/master/development/_model/AdminPageFramework_CSS.php).
- Translate the language files in the [language](https://github.com/michaeluno/admin-page-framework/tree/master/language) directory.
## Supporting Future Development ##
If you like the library, please rate and review it in the [WordPress Plugin Directory](http://wordpress.org/support/view/plugin-reviews/admin-page-framework?filter=5). Also donation would be greatly appreciated. Thank you!
[](http://en.michaeluno.jp/donate)
## Copyright and License ##
### Admin Page Framework ###
Released under the [MIT license](./development/MIT-LICENSE.txt).
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](http://opensource.org/licenses/MIT)
### Admin Page Framework - Demo ###
Released under the [GPL v2](./LICENSE.txt) 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.