by Michael Uno
5 (23 reviews)
Admin Page Framework
Facilitates WordPress plugin and theme development.
Tested up to WP 5.9 (Current: 6.9)
v3.9.1
Current Version v3.9.1
Updated 3 years ago
Last Update on 15 Apr, 2022
Synced 11 hours ago
Last Synced on
Rank
#15,994
+484 this week
Active Installs
100+
-23.7%
KW Avg Position
N/A
—
No change
Downloads
63.9K
+10 today
Support Resolved
0%
—
No change
Rating
100%
Review 5 out of 5
5
(23 reviews)
Next Milestone 200
100+
200+
2,840
Ranks to Climb
-
Growth Needed
8,000,000
Active Installs
Pro
Unlock Exact Install Count
See the precise estimated active installs for this plugin, calculated from real-time ranking data.
- Exact install estimates within tiers
- Track install growth over time
- Milestone progress predictions
Need 73 more installs to reach 200+
Rank Changes
Current
#15,994
Change
Best
#
Downloads Growth
Downloads
Growth
Peak
Upgrade to Pro
Unlock 30-day, 90-day, and yearly download history charts with a Pro subscription.
Upgrade NowReviews & Ratings
5.0
23 reviews
Overall
100%
5
23
(100%)
4
0
(0%)
3
0
(0%)
2
0
(0%)
1
0
(0%)
Tracked Keywords
Showing 0 of 0| Keyword | Position | Change | Type | Updated |
|---|---|---|---|---|
| No keyword data available yet. | ||||
Unlock Keyword Analytics
Track keyword rankings, search positions, and discover new ranking opportunities with a Pro subscription.
- Full keyword position tracking
- Historical ranking data
- Competitor keyword analysis
Track This Plugin
Get detailed analytics, keyword tracking, and position alerts delivered to your inbox.
Start Tracking FreePlugin Details
- Version
- 3.9.1
- Last Updated
- Apr 15, 2022
- Requires WP
- 3.4+
- Tested Up To
- 5.9
- PHP Version
- N/A
- Author
- Michael Uno
Support & Rating
- Rating
- ★ ★ ★ ★ ★ 5
- Reviews
- 23
- Support Threads
- 0
- Resolved
- 0%
Keywords
Upgrade to Pro
Unlock keyword rankings, search positions, and detailed analytics with a Pro subscription.
Upgrade NowSimilar Plugins
WP Adminify – White Label WordPress, Admin Menu Editor, Login Customizer
7K+ installs
#2,736
Master Addons For Elementor - White Label, Free Widgets, Hover Effects, Conditions, & Animations
40K+ installs
#929
MW
MW WP Form
200K+ installs
#262
Newsletters, Email Marketing, SMS and Popups by Omnisend
200K+ installs
#279
Crowdsignal Forms
100K+ installs
#306
Frequently Asked Questions
Common questions about Admin Page Framework
This is a PHP class-based WordPress library that helps to create option pages and form fields in the administration area. In addition, it helps to manage to save, export, and import options.
WordPress plugin/theme developers who publish own products and want to speed up creating setting forms, widgets, contact form etc. and don't want to require their users to install extra dependencies.
No. Include the generated framework files in your distribution package. You can generate your own framework files via Dashboard -> Admin Page Framework -> Tools -> Generator.
Go to Dashboard -> Admin Page Framework -> Tools -> Generator and download the files.
No. The loader plugin is released under GPLv2 or later but the library itself is released under MIT. Make sure to include only the library file.
Yes, it works with WordPress MU.
Technical Questions
Technical Questions
Yes. For built-in root menu items or to create your own ones, you need to use the setRootMenuPage() method. For root pages of custom post types, use setRootMenuPageBySlug().
$this->setRootMenuPageBySlug( 'edit.php?post_type=apf_posts' );
$this->setRootMenuPageBySlug( 'edit.php?post_type=apf_posts' );
The framework stores them as an organized multidimensional array in the options table in a single row. So use the get_option() function and pass the instantiated class name as the key or the custom key if you specify one in the constructor.
For instance, if your instantiated class name is APF then the code would be
$my_options = get_option( 'APF' );
And the option data is formed as an array with a structure like the following.
$my_options = array(
// field id => field value
'field_a' => 'value for field a'
'field_b' => 'value for field b'
...
// section id => array(
// field id => value,
// )
'section_a' => array(
'field_a' => 'value for field_a of section_a',
'field_b' => 'value for field_b of section_b',
...
),
'section_b' => array(
'field_a' => 'value for field_a of section_b',
'field_b' => 'value for field_b of section_b',
...
),
...
);
If you are new to PHP, you may feel uncomfortable dealing with multi-dimensional arrays because you would need to call isset() so many times. The framework has a utility method to help retrieve values of multi-dimensional arrays.
$_oUtil = new AdminPageFramework_WPUtility;
$value = $_oUtil->getElement(
$my_options, // (required) subject array
array( 'key_in_the_first_depth', 'key_in_the_second_depth' ), // (required) dimensional path
'My Default Value Here' // (optional) set your default value in case a value is not set
);
So for example, if you need to retrieve the value of field_a in section_b, you can do something like this.
$value = $_oUtil->getElement(
$my_options,
array( 'section_b', 'field_a' ),
'some default value'
);
In the framework factory class, you can access the utility object as it is defined already.
$value = $this->oUtil->getElement( $subject, $keys, $default );
For instance, if your instantiated class name is APF then the code would be
$my_options = get_option( 'APF' );
And the option data is formed as an array with a structure like the following.
$my_options = array(
// field id => field value
'field_a' => 'value for field a'
'field_b' => 'value for field b'
...
// section id => array(
// field id => value,
// )
'section_a' => array(
'field_a' => 'value for field_a of section_a',
'field_b' => 'value for field_b of section_b',
...
),
'section_b' => array(
'field_a' => 'value for field_a of section_b',
'field_b' => 'value for field_b of section_b',
...
),
...
);
If you are new to PHP, you may feel uncomfortable dealing with multi-dimensional arrays because you would need to call isset() so many times. The framework has a utility method to help retrieve values of multi-dimensional arrays.
$_oUtil = new AdminPageFramework_WPUtility;
$value = $_oUtil->getElement(
$my_options, // (required) subject array
array( 'key_in_the_first_depth', 'key_in_the_second_depth' ), // (required) dimensional path
'My Default Value Here' // (optional) set your default value in case a value is not set
);
So for example, if you need to retrieve the value of field_a in section_b, you can do something like this.
$value = $_oUtil->getElement(
$my_options,
array( 'section_b', 'field_a' ),
'some default value'
);
In the framework factory class, you can access the utility object as it is defined already.
$value = $this->oUtil->getElement( $subject, $keys, $default );
Yes, there are two main means to achieve that.
Use the value argument in the field definition array to suppress the displaying value in the field.
See an example. https://gist.github.com/michaeluno/fb4088b922b71710c7fb
Override the options array set to the entire form using the options_{instantiated class name} filter hook or pre-defined method.
See an example. https://gist.github.com/michaeluno/fcfac27825aa8a35b90f
When you go with the second method, make sure to pass an empty string, '', to the first parameter of the constructor so that it disables the ability to store submitted form data into the options table.
new MyAdminPage( '' );
Use the value argument in the field definition array to suppress the displaying value in the field.
See an example. https://gist.github.com/michaeluno/fb4088b922b71710c7fb
Override the options array set to the entire form using the options_{instantiated class name} filter hook or pre-defined method.
See an example. https://gist.github.com/michaeluno/fcfac27825aa8a35b90f
When you go with the second method, make sure to pass an empty string, '', to the first parameter of the constructor so that it disables the ability to store submitted form data into the options table.
new MyAdminPage( '' );
Say, in your main plugin, your class MyAdminPageClassA created a top-level page. In your extension plugin, you want to add sub-menu pages from another instance MyAdminPageClassB.
In the setUp() method of MyAdminPageClasB, pass the instantiated class name of the main plugin that created the root menu, MyAdminPageClassA, to the setRootMenuPageBySlug() method.
$this->setRootMenuPageBySlug( 'MyAdminPageClassA' );
Another option is to use the set_up_{class name} action hook. The callback method receives the admin page class object and you can access the framework methods to add sub-menu pages.
class ThirdPartyScript {
public function __construct() {
add_action( 'set_up_' . 'MyAdminPageClassA', array( $this, 'replyToAddSubMenuPages' ) );
}
public function replyToAddSubMenuPages( $oAdminPage ) {
$oAdminPage->addSubMenuPage(
array(
'page_slug' => 'my_admin_page_b',
'title' => __( 'Example', 'your-text-domain' ),
'order' => 20,
)
);
}
}
new ThirdPartyScript;
See an example.
In the setUp() method of MyAdminPageClasB, pass the instantiated class name of the main plugin that created the root menu, MyAdminPageClassA, to the setRootMenuPageBySlug() method.
$this->setRootMenuPageBySlug( 'MyAdminPageClassA' );
Another option is to use the set_up_{class name} action hook. The callback method receives the admin page class object and you can access the framework methods to add sub-menu pages.
class ThirdPartyScript {
public function __construct() {
add_action( 'set_up_' . 'MyAdminPageClassA', array( $this, 'replyToAddSubMenuPages' ) );
}
public function replyToAddSubMenuPages( $oAdminPage ) {
$oAdminPage->addSubMenuPage(
array(
'page_slug' => 'my_admin_page_b',
'title' => __( 'Example', 'your-text-domain' ),
'order' => 20,
)
);
}
}
new ThirdPartyScript;
See an example.