refactor: remove Tools → My Notes shortcut, redirect legacy URL to main page

The "Tools → My Notes" admin menu shortcut routed to a separate
bare-bones create form at ?page=wp-notes-create with no notes list,
no styling, no parity with the main My Notes page. It was a third
route to "create a note" duplicating the two that already work
better: the proper WP Notes → My Notes sidebar entry, and the admin-
bar "New Note" quick-jump that lands on the same page's form.

CHANGES
- Removed the wp_notes_add_tools_menu() registration (add_management_page
  + its admin_menu hook).
- Deleted the wp_notes_create_page() function in full — the bare-bones
  renderer, no longer referenced anywhere.
- Added wp_notes_redirect_legacy_create_page() on admin_init: anyone
  hitting the legacy ?page=wp-notes-create URL (stale bookmark, old
  email link, etc.) is wp_safe_redirect()-ed to ?page=wp-notes. No
  404 / no "insufficient permissions" page for old links.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 07:59:01 +01:00
parent 35920fea07
commit 3801cc283b
2 changed files with 43 additions and 37 deletions
+26
View File
@@ -7,6 +7,32 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/) — versi
## [Unreleased]
### Removed — Tools → My Notes shortcut (with backward-compatible redirect)
The "Tools → My Notes" admin menu shortcut has been removed. It
routed to a separate bare-bones form at `?page=wp-notes-create`
rendered by `wp_notes_create_page()` — a stripped-down create form
with no notes list, no styling, and no parity with the main page.
The shortcut was a third route to "create a note" duplicating the
two that already exist and work better:
1. **WP Notes → My Notes** in the admin sidebar (the proper page —
styled form + active/completed lists + edit + restore).
2. **Admin bar → WP Notes → New Note** quick-access (jumps to the
form on the main page via `#new-note` anchor).
**Backward-compat redirect:** anyone hitting the legacy
`?page=wp-notes-create` URL (stale bookmark, old email link, etc.)
is now `wp_safe_redirect()`-ed to `?page=wp-notes` via an
`admin_init` hook. No 404 / no "you do not have sufficient
permissions" page.
**Code removed:**
- `wp_notes_add_tools_menu()` registration (the `add_management_page`
call and its `add_action('admin_menu', ...)` hook).
- `wp_notes_create_page()` function body in full — the bare-bones
form renderer, no longer referenced anywhere.
### Added — Persistent dismissal of the empty-state notice (user_meta)
The "No active/completed notes found" notice was already
dismissible per-page-load, but pressing X only hid it for the