diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..98500ff --- /dev/null +++ b/CHANGELOG.md @@ -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. diff --git a/wp-notes.php b/wp-notes.php index cfab3f8..06f15e8 100644 --- a/wp-notes.php +++ b/wp-notes.php @@ -1513,14 +1513,20 @@ function wp_notes_register_cpt() { $args = array( 'labels' => $labels, 'public' => false, - 'show_ui' => true, - 'show_in_menu' => 'wp-notes', + // show_ui=false: the live UI stores notes in wp_options, not as + // CPT posts. show_ui=true caused WordPress to auto-inject "All + // Notes" and "Add New" submenus that pointed at post-new.php and + // routed users into the standard post editor — which writes to + // the wrong storage. The CPT remains registered so the + // wp_notes_migrate_to_cpt() helper can still use wp_insert_post. + 'show_ui' => false, + 'show_in_menu' => false, 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('title', 'editor', 'author', 'custom-fields'), 'has_archive' => false, 'menu_position' => null, - 'show_in_rest' => true, + 'show_in_rest' => false, ); register_post_type('wp_note', $args); @@ -1543,10 +1549,13 @@ function wp_notes_register_cpt() { register_taxonomy('wp_note_category', 'wp_note', array( 'hierarchical' => true, 'labels' => $tax_labels, - 'show_ui' => true, - 'show_admin_column' => true, + // Hidden alongside the parent CPT — live UI doesn't surface + // categories yet, and showing the taxonomy in admin with the + // parent hidden would just dead-link. + 'show_ui' => false, + 'show_admin_column' => false, 'query_var' => true, - 'show_in_rest' => true, + 'show_in_rest' => false, )); } add_action('init', 'wp_notes_register_cpt');