Skip to content
Ruhani RabinRuhani Rabin

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:
  1. Custom Admin Bar Menu: Adds a customizable dropdown menu to the WordPress admin bar.
  2. Configuration Screen: This screen provides an interface in the WordPress admin area for configuring the dropdown menu's title and items.
  3. Dynamic Menu Management: Allows administrators to add and remove menu items dynamically through the settings page.
  4. Manage Menu Link: The dropdown menu automatically includes a "Manage Menu" link as the last item, linking to the settings page.
  5. User Permissions: Ensures only users with the 'manage_options' capability can access and modify the settings.
This plugin is ideal for administrators who want to enhance the functionality of their WordPress admin bar with a custom, easily configurable dropdown menu.

Additional Snippets

Implementation Steps

  1. Open your theme’s functions.php file. Or Add a New Snippet in WPCodeBox
  2. Add the provided code snippet.
  3. Save the file and refresh your website to see the badges in action.
View on GitHub
Share: