Download the PHP package ssovit/wp-util without Composer
On this page you can find all versions of the php package ssovit/wp-util. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wp-util
WordPress Utilities
Simple yet powerful utility that I use mostly for my client's projects. This project was built over time so I could re-use them over multiple of my projects.
This project was actually built to have clean admin interface with ability to add tabbed settings page.
Admin Settings Builder
Available Methods
set_page_id($page_id)
- Unique Page ID (if page id ismy-setting-page
then setting page url would be/wp-admin/admin.php?page=my-setting-page
)set_capability($capability)
- Set capability (eg:manage_options
)set_menu_title($menu_title)
- Admin menu nameset_page_title($page_title)
- Admin setting page titleset_icon($icon)
- (dashicon, icon url) Menu iconset_setting_key($setting_key)
- Setting name keyset_menu_position($menu_position)
- Menu Positionset_menu_parent($menu_parent)
- Set menu parent (eg:options-general.php
if you want setting page as child ofSettings
page)
Available Hooks
sovit/settings/{$page_id}/tabs
- Register Setting Tab
Tabs also accept render_callback
if you require custom tab content
sovit/settings/{$page_id}/sections
- Register Setting Section
Sections also accept render_callback
if you require custom section content
sovit/settings/{$page_id}/fields
- Register Setting Fields
Fields also accept render_callback
if you require custom field content
Field validation and sanitization
Work In Progress
This project is work in progress but is usable as is. There are more features, but not yet documented.
Want to contribute
If you want to contribute, create pull request.