ux: Tier 1 cleanup of wp_notes_page_callback — single H1, collapse triple welcome surfaces, footer support link
Single-pass UX cleanup of the main WP Notes admin page. Functionality
unchanged; the page is shorter, has one H1, and stops contradicting
itself.
CHANGES
- Single H1 on the page (was five different H1s).
- Welcome/about content collapsed from THREE on-page surfaces (top
dismissible notice + nested toggle + Show/Close button row) to one
single description line linking to the dedicated About page where
the long copy already lives.
- Two duplicate "Toggle Welcome Section" buttons with the SAME label
but different targets — both removed.
- Embedded "What's New v3.0.0" changelog block deleted: it was
hard-coded to v3.0.0 while the plugin reports v3.0.2. The real
history is in CHANGELOG.md.
- "Buy me a coffee" button moved from page header to page footer —
promo shouldn't be the first thing under the page title.
- Invalid HTML cleaned up (li outside ul, p wrapping div/ul) by way
of removing the welcome blob that contained it.
- Dead bulk-action UI removed: per-row checkboxes and "Select all"
header in both wp_notes_display_notes() and wp_notes_list_table()
rendered but nothing acted on the selection. Removed with inline
comments marking the spot for when real bulk-actions land. Edit
form colspan adjusted to match the new column count.
- ~80 lines of inline style+script for the about-box dismissal
removed (localStorage tracking, show/hide handlers, two style
blocks). WordPress's notice notice-info is-dismissible + user-meta
is the right path if a banner needs to return.
- toggleSection() JS helper removed (no toggles remain).
- Small CSS additions to inc/wp-notes-styles.php for the header
banner and footer-support link.
ALSO FIXED
- PHP 8.2 deprecation: ${size}px → {$size}px in the dashboard
list-table render. ${var} interpolation is deprecated since 8.2
and will hard-error in 9.0.
NET DIFF: wp-notes.php -213 lines, total -111 lines across 4 files
(plus a new CHANGELOG entry). Storage model unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,9 +39,8 @@ function wp_notes_display_notes($type = 'active') {
|
||||
echo '<div class="wp-notes-list" id="' . esc_attr($type . '-notes') . '">';
|
||||
echo '<table class="wp-list-table widefat fixed striped has-hover">';
|
||||
echo '<thead><tr>';
|
||||
echo '<th scope="col" class="manage-column column-cb check-column">';
|
||||
echo '<input type="checkbox" id="select-all-' . esc_attr($type) . '" />';
|
||||
echo '</th>';
|
||||
/* No checkbox column — bulk actions are not wired up. Re-add this <th>
|
||||
and the matching <td> below when bulk select/delete/done is built. */
|
||||
echo '<th scope="col" class="manage-column column-primary">' . esc_html__('Note', 'a-wp-notes') . '</th>';
|
||||
echo '<th scope="col" class="manage-column">' . esc_html__('Author', 'a-wp-notes') . '</th>';
|
||||
echo '<th scope="col" class="manage-column">' . esc_html__('Created', 'a-wp-notes') . '</th>';
|
||||
@@ -61,7 +60,6 @@ function wp_notes_display_notes($type = 'active') {
|
||||
$author = esc_html($note['author_name'] ?? 'Unknown');
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td><input type="checkbox" name="note_ids[]" value="' . esc_attr($key) . '" class="note-checkbox" /></td>';
|
||||
echo '<td style="color: ' . $color . '; font-size: ' . $size . 'px; font-family: ' . $font . ';">' . $text . '</td>';
|
||||
echo '<td>' . $author . '</td>';
|
||||
echo '<td>' . $timestamp . '</td>';
|
||||
@@ -91,7 +89,9 @@ function wp_notes_display_notes($type = 'active') {
|
||||
|
||||
// Edit form (for active notes only)
|
||||
if ($type === 'active') {
|
||||
echo '<tr id="edit-note-' . esc_attr($key) . '" style="display:none;"><td colspan="6">';
|
||||
/* Active rows have 4 columns: Note, Author, Created, Actions
|
||||
(no longer a checkbox column). Edit form spans all 4. */
|
||||
echo '<tr id="edit-note-' . esc_attr($key) . '" style="display:none;"><td colspan="4">';
|
||||
echo '<form class="edit-note-form" data-note-id="' . esc_attr($key) . '">';
|
||||
wp_nonce_field('wp_notes_nonce', '_wpnonce');
|
||||
echo '<input type="hidden" name="note_id" value="' . esc_attr($key) . '">';
|
||||
|
||||
Reference in New Issue
Block a user