automattic / jetpack-admin-ui
Generic Jetpack wp-admin UI elements
Installs: 1 672 262
Dependents: 7
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 2
Type:jetpack-library
Requires
- php: >=7.0
Requires (Dev)
- automattic/jetpack-changelogger: ^4.2.8
- automattic/jetpack-logo: ^2.0.5
- automattic/wordbless: dev-master
- yoast/phpunit-polyfills: ^1.1.1
Suggests
- automattic/jetpack-autoloader: Allow for better interoperability with other plugins that use this package.
- dev-trunk / 0.4.x-dev
- v0.4.6
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.25
- v0.2.24
- v0.2.23
- v0.2.22
- v0.2.21
- v0.2.20
- v0.2.19
- v0.2.18
- v0.2.17
- v0.2.16
- v0.2.15
- v0.2.14
- v0.2.13
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.1
- v0.1.0
- dev-prerelease
- dev-fix/slack-workflow-branch-detection
- dev-fix/release-branch-typo
This package is auto-updated.
Last update: 2024-11-04 16:28:11 UTC
README
Generic Jetpack wp-admin UI elements
How to use
Menu Registration
Use the Admin_Menu class to add your plugin under the Jetpack top level menu in WP-Admin.
This package will make sure to register the top level menu, if not registered yet, and will add the new menu(s) item(s) under it.
Use the add_menu
to register your menu, no need to do it inside the admin_menu
hook. You can do it in your plugin initialization.
The parameters this method gets are the same parameters add_submenu_page
gets, except that you don't need to inform parent
menu.
Example:
use Automattic\Jetpack\Admin_UI\Admin_Menu; $page_suffix = Admin_Menu::add_menu( __( 'My Awesome plugin', 'my-awesome-plugin' ), __( 'My Awesome plugin', 'my-awesome-plugin' ), 'manage_options', 'my-awesome-plugin', '__my_plugin_page_callback' ); add_action( 'load-' . $page_suffix, 'my_plugin_do_stuff_on_page_load' );
Security
Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.
License
admin-ui is licensed under GNU General Public License v2 (or later)