=== Lightweight Admin Toolbar Toggle ===
Contributors: aldibudimanputra
Donate link: https://aldifajar.com
Tags: admin, toolbar, admin-bar, toggle, hide
Requires at least: 4.6
Tested up to: 6.9
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A plugin to toggle the WordPress admin bar and make it float without taking up page space. Only visible to Administrators.

== Description ==

Lightweight Admin Toolbar Toggle allows Administrators to toggle the WordPress admin bar on/off from the frontend. The admin bar floats over content without pushing the page layout, providing a seamless experience.

### Features

*   Toggle admin bar visibility with a floating button
*   Admin bar floats over content - no layout shift
*   Settings page to choose the toggle button position (8 positions around the screen edge)
*   Show or hide the toggle on specific pages with include/exclude URL rules and * wildcards
*   Optionally remember the toolbar open/closed state between pages (browser localStorage, no database writes)
*   Optionally hide the front-end toolbar completely for non-administrator users
*   Only visible to Administrators
*   Compatible with popular page builders (Elementor, Divi, Astra, etc.)
*   Stays out of the Elementor editor/preview and the Customizer preview
*   Shields the toolbar from theme CSS resets that break its layout and icons
*   Keyboard accessible toggle button (Enter/Space) with proper ARIA attributes
*   Glassmorphism styled toggle button
*   Translation ready
*   Cleans up its settings on uninstall

== Installation ==

1. Upload the `admin-toolbar-toggle` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Only Administrator users will see the floating toggle button on the frontend
4. Configure the button position and page visibility under Settings > Toolbar Toggle

== Frequently Asked Questions ==

= Who can see the toggle button? =

Only users with Administrator role can see and use the toggle button.

= How to fix the toggle button not showing? =

If you are an Administrator and the toggle is not showing, please ensure that you have checked the "Show Toolbar when viewing site" option in your WordPress Dashboard under Users > Profile. Also check Settings > Toolbar Toggle in case the current URL is excluded by your page visibility rules.

= Can I change where the toggle button appears? =

Yes. Go to Settings > Toolbar Toggle and pick one of the 8 positions around the screen edge (top, middle, bottom on either side, or top/bottom center). The default is Middle Right.

= Can I limit the toggle to certain pages? =

Yes. In Settings > Toolbar Toggle you can either show the toggle on every page except a list of URLs, or only on the URLs you list. Relative paths (/contact), full URLs, and the * wildcard (/shop/*) are supported.

= Does this plugin work with page builders? =

Yes! This plugin includes fixes for common sticky header issues with Elementor, Divi, Astra, and other popular themes and page builders. It also automatically disables itself inside the Elementor editor/preview and the Customizer preview.

= Will this affect my website layout? =

No. The admin bar floats over your content without pushing the page layout down. The plugin also removes the default WordPress "bump" that usually adds space to the top of your page.

= Is the admin bar hidden by default? =

Yes, the admin bar is hidden by default. Click the floating toggle button to show it. With "remember state" enabled (the default), the open/closed state persists between pages in your browser.

== Screenshots ==

1. Floating toggle button on the right side of the screen
2. Admin bar shown when toggle is clicked

== Changelog ==

= 2.0.0 =
* New: Settings page under Settings > Toolbar Toggle
* New: Choose the toggle button position from 8 spots around the screen edge
* New: Per-URL visibility rules (include or exclude mode) with * wildcard support
* New: Option to remember the toolbar open/closed state between pages (browser localStorage)
* New: Option to hide the front-end toolbar for non-administrator users (now configurable)
* New: Settings link on the Plugins screen
* Improved: Toolbar is now shielded from theme CSS resets (box-sizing, list bullets, link underlines, image max-widths, font overrides) so it always renders correctly
* Improved: Layout protection is now minimal and server-side (admin-bar body class and core bump removed before render) instead of aggressive CSS overrides
* Improved: Toggle button is keyboard accessible (Enter/Space) with aria-pressed and aria-label
* Improved: Plugin stays inactive inside the Elementor editor/preview and the Customizer preview
* Improved: Capability check now uses manage_options instead of the administrator role name
* Improved: Translation ready with the admin-toolbar-toggle text domain
* Improved: Settings are removed from the database on uninstall

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 2.0.0 =
Major update: adds a settings page with button position, per-URL visibility rules, remember state, and better theme compatibility.

= 1.0.0 =
Initial release of Lightweight Admin Toolbar Toggle plugin.
