Quick Access Menu – Custom Dropdown for WP Admin Bar with Options Page
WPCodeBox
This PHP code creates a WordPress plugin named "Custom Admin Bar Dropdown." The plugin adds a custom dropdown menu with configurable menu items to the WordPress admin bar. It includes a settings page where administrators can set the dropdown menu's title and define its items (title and URL). The settings page allows for the dynamic addition and removal of menu items through a user-friendly interface.
Key Features:
- Custom Admin Bar Menu: Adds a customizable dropdown menu to the WordPress admin bar.
- Configuration Screen: This screen provides an interface in the WordPress admin area for configuring the dropdown menu's title and items.
- Dynamic Menu Management: Allows administrators to add and remove menu items dynamically through the settings page.
- Manage Menu Link: The dropdown menu automatically includes a "Manage Menu" link as the last item, linking to the settings page.
- User Permissions: Ensures only users with the 'manage_options' capability can access and modify the settings.
Additional Snippets
Implementation Steps
- Open your theme’s
functions.phpfile. Or Add a New Snippet in WPCodeBox - Add the provided code snippet.
- Save the file and refresh your website to see the badges in action.