03/09
2017
Wallogit.com
2017 © Pedro Peláez
A class for creating WordPress administration pages.
An extensible class for quickly creating WordPress administration screens., (*1)
composer require wp-orbit/wp-admin-settings-page
Create an AbstractSettingsPage class extension., (*2)
null,
/* If set, this page is added as a submenu page.
If not set, this page is added as a top level menu item.
Example: 'tools.php' for Tools or 'options-general.php' for Settings. */
'parent_slug' => '',
/* Sets the menu and page titles. */
'page_name' => 'Example Settings Page',
/* A URL friendly unique slug for this menu page. */
'page_slug' => 'example-settings-page',
/* A URL to image file or WP Dashicon string.
If not set the default icon will display.
https://developer.wordpress.org/resource/dashicons/ */
'icon' => '',
/* An array of [tab_key => tab_label] key value pairs.
These generate our tabs, define our rendering functions, and POST save callbacks.
Each key needs a corresponding render function (with the same name) in this class.
Note - make sure not to override any parent class functions (or just prefix your keys).
Each value represents the tab label. */
'tabs' => [
'options' => 'Options',
]
];
// Initialize parent functionality.
parent::__construct( $args );
}
/* Each render function is automatically wrapped in a