fix: hide unused wp_note CPT from admin UI to stop "Add New Note" misroute

The plugin registered a wp_note CPT with show_ui=true and show_in_menu=
'wp-notes', which caused WordPress to auto-inject "All Notes" and
"Add New" submenus under the WP Notes admin menu. The "Add New"
submenu routed to post-new.php?post_type=wp_note — the standard WP
post editor — but the live plugin stores notes in wp_options
(get_option('wp_notes')), not as CPT posts. Anyone clicking that
submenu ended up writing to the wrong storage and their note never
appeared in the WP Notes list.

Fix: show_ui and show_in_menu set to false on the wp_note CPT, and
show_ui / show_admin_column / show_in_rest set to false on the
wp_note_category taxonomy. The CPT/taxonomy remain registered so the
wp_notes_migrate_to_cpt() helper can still call wp_insert_post() —
just no admin UI side-effects until the migration is completed and
the live storage swaps over.

Also adds CHANGELOG.md in Keep-a-Changelog format with the
[Unreleased] entry for this fix and a 3.0.2 baseline note for the
"trimmed from v1.1.5 feature-creep" lineage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 07:26:04 +01:00
parent 433de27d9b
commit 05d8ad52ad
2 changed files with 81 additions and 6 deletions
+66
View File
@@ -0,0 +1,66 @@
# Changelog
All notable changes to **A-WP-Notes** are documented here.
Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/) — versioning: [SemVer](https://semver.org/).
---
## [Unreleased]
### Fixed
- **"Add New Note" sidebar submenu opening the WordPress post editor.**
The plugin registered a `wp_note` custom post type with
`show_ui => true` and `show_in_menu => 'wp-notes'`, which caused
WordPress to auto-inject "All Notes" and "Add New" submenus under
the WP Notes admin menu. The "Add New" submenu routed to
`post-new.php?post_type=wp_note` — the standard WordPress post
editor — but the live plugin stores notes in `wp_options`
(`get_option('wp_notes')`), not as CPT posts. Saving in the post
editor wrote to the wrong storage and the new note never appeared
in the WP Notes list. Discovered 2026-05-25.
Fixed by setting `show_ui` and `show_in_menu` to `false` on the
`wp_note` CPT, and `show_ui` / `show_admin_column` /
`show_in_rest` to `false` on the `wp_note_category` taxonomy. The
CPT and taxonomy remain registered so `wp_notes_migrate_to_cpt()`
can still use `wp_insert_post()` if/when the migration is run.
The form on the actual WP Notes page (the one that POSTs to the
same admin page) continues to work unchanged.
### Notes
- The plugin currently uses **two storage models**: the active one is
`wp_options` (key `wp_notes`, with completed notes in
`wp_done_notes`). The CPT + meta storage is the *target* of an
unfinished migration; the helper `wp_notes_migrate_to_cpt()` is
defined but unused by the live UI. Until that migration is
completed, hiding the CPT from the admin UI prevents users from
accidentally writing to the wrong store.
---
## [3.0.2] — 2025-05-10 (last released version, baseline)
The v3 "without all the crap" release. Trimmed from the v1.1.5
feature-creep era which had bolted on:
- AI chat (multiple variants)
- AI personalities
- Journal mode
- Speedtest
- Tamagotchi (yes, really)
- Backup
- And more
v3 strips back to the essentials:
- Notes list (in `wp_options`)
- Create note form (color, size, font, emoji)
- Admin bar quick-access menu
- Settings page
- Import / Export
- About page
- Update checker
This baseline entry exists for historical context; future releases
should keep adding entries above and remove this note once a real
changelog history accrues.