=== The 9 Dollar Menu Valet ===
Contributors: the9dollarplugins
Donate link: https://buymeacoffee.com/t.9.p
Tags: admin menu, hide menu items, menu manager, admin sidebar, reorder menu
Requires at least: 5.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Take full control of your WordPress admin sidebar: hide items with a click, reorder them via drag & drop, and rename them to fit your workflow.

== Description ==

Take full control of your WordPress admin sidebar — without touching a single line of code. Hide any menu item with a checkbox click, reorder everything via drag & drop, and keep your backend clean and focused.

**Why you'll actually like it**
Let's be honest: the WordPress admin sidebar can be a mess. Plugins keep adding their own menu items, custom post types pile up, and suddenly you're scrolling past fifteen things you never use. Menu Valet gives you back control — no CSS hacks, no `remove_menu_page()` functions in your `functions.php`, no frustration.
Just checkboxes and drag & drop.

**Core Features — LITE (free)**
- **See everything in one overview** — all admin menu items and their submenus, clearly laid out
- **Hide any menu item with one click** — checkbox toggles via Ajax, instant result
- **Reorder via drag & drop** — grab any item and move it up or down. Also Ajax, also instant
- **Changes apply to all users** — anyone with `manage_options` sees the same clean sidebar
- **Auto-hide submenus** — hide a parent item, all its children disappear too
- **Smart submenu locking** — when parent is hidden, submenus are automatically disabled
- **Supports everything** — WordPress core, plugins, custom post types, you name it
- **Snapshot system** — captures original menu before you change anything. Safety net included
- **High priority hooks** — changes apply late, so no conflicts with other menu-altering plugins
- **Delete data on uninstall option** — your call whether to leave a trace
- **Lightweight** — no bloat, no external dependencies, no drama

**PRO Version extras**
- **Live search in the admin sidebar** — start typing, menu items filter instantly. Great for deep backends
- **Rename any menu or submenu item inline** — click, edit, done. Original name preserved as tooltip
- **Custom sidebar width** — live slider from 160 px to 380 px. Make it narrow or spacious, your call
- **Priority support** — because sometimes you need a human

**How it works**
1. Install and activate the plugin.
2. Go to **Menu Valet** in your WordPress admin sidebar.
3. See your entire menu structure — parents, children, everything.
4. Hide what you don't need (checkboxes). Reorder the rest (drag & drop).
5. That's it. Your admin sidebar is now yours.

**Behind the scenes (for the curious)**
The plugin hooks into the WordPress admin menu system and captures the full menu structure before any modifications are applied. That snapshot is your safety net.
When you hide or reorder items, your changes are saved via AJAX — no page reloads, no waiting.
Hidden items are removed from the global `$menu` and `$submenu` arrays before rendering. They simply don't exist as far as the sidebar output is concerned.
Menu order uses WordPress's built-in `custom_menu_order` and `menu_order` filters. The plugin merges your saved order with newly registered menu items — so when you install a new plugin, its menu item appears at the bottom (until you move it).

No core files are ever touched. Everything runs through standard WordPress hooks. Safe, clean, reversible.

== Screenshots ==

1. Dashboard view
2. Table view
3. Sort menus your way

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via the WordPress Plugins screen.
2. Activate the plugin — the usual way.
3. Open **Menu Valet** in your WordPress admin sidebar.
4. Check items to hide them, drag to reorder them. Done.

That's literally it.

== Frequently Asked Questions ==

= Will hidden menu items be deleted? =
No. They are only hidden from the admin interface. The menu items still exist, WordPress still knows about them, and any user with the right permissions can still access them via direct URL. The plugin just tells the sidebar: "don't show this."

= Can I hide submenu items individually? =
Yes — unless the parent item is hidden. If you hide a parent, all its submenus are automatically hidden too (because there's no parent to attach them to). If the parent is visible, you can hide individual submenus independently.

= Can I reorder menu items? =
Yes. Drag & drop. Anywhere. Up, down, wherever you want. The order saves instantly via AJAX.

= What happens when new plugins add menu items? =
They are automatically appended at the bottom of your menu — and they stay visible until you decide to hide or move them. The plugin never assumes you want to auto-hide new things.

= Will hidden menu items still be accessible via direct URL? =
Yes. Important: this plugin only hides items **visually**. It does **not** change user capabilities or block direct URL access. If someone knows the URL (`/wp-admin/edit.php?post_type=page`), they can still get there. This is by design — Menu Valet is a UI cleaner, not a security or permissions plugin.

= I accidentally hid the Menu Valet itself — what do I do? =
Oops. Navigate directly to `wp-admin/admin.php?page=the-9-dollar-menu-valet`. Once you're there, simply uncheck the box for Menu Valet and save. You're back in business.

= Can I rename menu and submenu items? =
Yes — but only with **PRO**. Click the "Rename" button on any item, edit the label inline, and hit enter. The original name is always preserved and shown as a tooltip when you hover over the renamed item. So you never forget what it originally was.

= Can I adjust the width of the admin sidebar? =
Yes — but only with **PRO**. A live slider lets you set any width from 160 px up to 380 px. Changes apply immediately across the entire WordPress backend. No CSS fiddling, no custom stylesheets.

= Does it work with custom post types and third-party plugin menus? =
Yes. Every item registered in the WordPress `$menu` and `$submenu` globals is supported. That means:
- WordPress core menu items (Posts, Pages, Comments, etc.)
- Custom post types (including those from CPT UI or ACF)
- Plugin menu items (WooCommerce, Yoast, Elementor, you name it)
- Network admin menu items (if you're on Multisite)

= What happens if I deactivate the plugin? =
All menu items return to their default state — original order, everything visible. Your settings are preserved in the database, so when you reactivate, everything goes back to how you left it.

= What happens if I uninstall the plugin? =
Your settings are only deleted if you enabled the **"Delete data on uninstall"** option in the plugin settings. By default, your menu configuration stays in the database (just in case you reinstall later). If you want a complete wipe, check that box before uninstalling.

= Does it work with admin themes or white-labeling plugins? =
Generally yes, but it depends. Menu Valet hooks into WordPress at a high priority (late), which means it usually plays nice with other menu-altering plugins. However, if another plugin completely rebuilds the menu from scratch or uses aggressive filtering, conflicts can happen. Test it — 99% of cases work fine.

= Is there a REST API? =
Yes. Menu Valet includes REST API endpoints for headless or programmatic access. You can:
- Get the current menu structure
- Hide/unhide items
- Reorder items

This is primarily for developers who want to sync menu settings across environments or build custom interfaces.

= Does it work with the WordPress Toolbar (admin bar)? =
No. Menu Valet only affects the **admin sidebar** (the main left-hand menu). The top admin bar is completely untouched. Different plugin, different problem.

= Do I need an API key or an account anywhere? =
No. Never. Menu Valet runs entirely on your own server. No external services, no registration, no monthly fees for the LITE version.

== Changelog ==

= 1.4 - 2026-08-06 =
* Fixed: Menu table in admin page now reflects the correct order of the WordPress sidebar menu.
* Fixed: Minor CSS bug.

= 1.3 - 2026-06-08 =
* Code cleanup and bug fixes
* Review Notice fixed

= 1.2 - 2026-05-20 =
* Fixed: WordPress.org review link corrected.
* Improved: Menu Valet's own entry is now highlighted in the menu table to prevent accidental changes.
* Updated: readme.txt.

= 1.1 - 2026-04-12 =
* Fixed: Admin page returned "You do not have permission.

= 1.0 - 2026-02-22 =
* Initial release.
* Hide admin menu items via checkbox (Ajax).
* Reorder admin menu items via drag & drop (Ajax).
* PRO: Live search field in the admin sidebar.
* PRO: Rename any menu or submenu item inline.
* PRO: Custom Sidebar Width — live slider from 160 px to 380 px.
* REST API endpoints for headless/programmatic access.
* Full i18n support.