michaeluno / admin-page-framework
A PHP class based framework which facilitates WordPress plugin and theme development.
Installs: 652
Dependents: 0
Suggesters: 0
Security: 0
Stars: 339
Watchers: 29
Forks: 71
Open Issues: 21
Type:wordpress-plugin
Requires
- php: >=5.2.4
Suggests
- composer/installers: ~1.0
- dev-master
- 3.9.1
- 3.9.0
- 3.8.34
- 3.8.33
- 3.8.32
- 3.8.31
- 3.8.30
- 3.8.29
- 3.8.28
- 3.8.27
- 3.8.26
- 3.8.25
- 3.8.24
- 3.8.23
- 3.8.22
- 3.8.21
- 3.8.20
- 3.8.19
- 3.8.18
- 3.8.17
- 3.8.16
- 3.8.15
- 3.8.14
- 3.8.13
- 3.8.12
- 3.8.11
- 3.8.10
- 3.8.9
- 3.8.8
- 3.8.7
- 3.8.6
- 3.8.5
- 3.8.4
- 3.8.3
- 3.8.2
- 3.8.1
- 3.8.0
- 3.7.15
- 3.7.14
- 3.7.13
- 3.7.12
- 3.7.11
- 3.7.10
- 3.7.9
- 3.7.8
- 3.7.7
- 3.7.6.1
- 3.7.4
- 3.7.3
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.6
- 3.6.5
- 3.6.4
- 3.6.3
- 3.6.2
- 3.6.1
- 3.6.0
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dev
This package is auto-updated.
Last update: 2024-10-08 18:07:27 UTC
README
Welcome to Admin Page Framework GitHub Repository
Admin Page Framework is an OOP based open source WordPress library that facilitates theme and plugin development.
Installation
There are mainly two ways to include the framework.
-
Use the framework loader plugin.
-
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
<?php /* Plugin Name: Admin Page Framework - Getting Started */ include( dirname( __FILE__ ) . '/library/apf/admin-page-framework.php' ); class APF extends AdminPageFramework { public function setUp() { $this->setRootMenuPage( 'Settings' ); // where to belong $this->addSubMenuItem( array( 'title' => 'My First Page', 'page_slug' => 'myfirstpage' ) ); } /** * @callback action do_{page slug} */ public function do_myfirstpage() { ?> <h3>Say Something</h3> <p>This is my first admin page!</p> <?php } } new APF;
Create a Form
<?php /* Plugin Name: Admin Page Framework - My First Form */ include( dirname( __FILE__ ) . '/library/apf/admin-page-framework.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. * @callback action load_{page slug} */ public function load_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', ) ); } } new APF_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:
- Report bugs.
- Post ideas on enhancements.
- Send us a Pull Request with your bug fixes and/or new features.
- Write a custom field type.
- Write test cases.
- Improve the documentation.
- Tweak the styling of the framework page elements.
- Translate the language files in the language directory to your native language.
- Possibly more.
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!