Skip to content

Conversation

@imantsk
Copy link
Member

@imantsk imantsk commented Jan 17, 2026

Summary

This PR brings a native Snippets QuickNav experience into Code Snippets via the WordPress Admin Bar. It adds a dedicated “Snippets” top-level admin bar menu with quick links plus paginated Active/Inactive snippet lists that update dynamically.

Credit

This work is based on the approach and UX established by “Snippets QuickNav” by David Decker – DECKERWEB (GitHub: @deckerweb):
https://github.com/deckerweb/snippets-quicknav
This PR implements the feature natively, following Code Snippets’ existing architecture and coding style.

What’s included

  • Admin Bar → Snippets menu using the existing scissors icon (styled to better match WP admin bar icons)
  • Main nodes:
    • Manage
    • Add New
    • Import
    • Settings
    • Active Snippets
    • Inactive Snippets
  • Active/Inactive lists:
    • Show snippet titles prefixed with type, e.g. (PHP) My snippet title (type inferred from type)
    • Paginate when the list exceeds the configured limit
    • Pagination controls live at the top of the submenu and fetch pages via the Snippets REST API
  • Safe Mode
    • Safe Mode indicator shows only when Safe Mode is active
    • Adds a Safe Mode docs link as a submenu item: https://snipco.de/safe-mode (opens in new tab, uses Dashicons)
  • Free vs Pro gating
    • Pro-only “Add New” types (CSS/JS/Conditions) are greyed out in free and link to the upgrade page

Settings added

  • Toggle to enable/disable the admin bar menu (default: enabled)
  • “Snippets per page in Admin Bar” (default: 20)

How to test

  1. Go to Code Snippets settings and confirm Admin Bar QuickNav is enabled; set the per-page limit to something small (e.g. 5).
  2. Open the WP Admin Bar → Snippets and verify the main nodes and submenu structure.
  3. Open Active Snippets / Inactive Snippets and click pagination controls; confirm the list updates correctly.
  4. Enable Safe Mode and confirm the Safe Mode indicator appears and the Safe Mode docs submenu link opens in a new tab.

imantsk and others added 27 commits January 6, 2026 23:57
fix: better handle null tags in snippet data
@imantsk imantsk changed the base branch from core to core-beta January 17, 2026 21:58
@imantsk imantsk requested a review from sheabunge January 19, 2026 17:21
@imantsk imantsk self-assigned this Jan 19, 2026
@imantsk imantsk marked this pull request as ready for review January 19, 2026 17:21
@code-snippets-bot code-snippets-bot added the run-tests Trigger automated tests label Jan 22, 2026
@imantsk imantsk changed the title feat: Native Admin Bar QuickNav (Snippets) by DECKERWEB [CWA-269] feat: Native Admin Bar QuickNav (Snippets) by DECKERWEB Jan 26, 2026
@notion-workspace
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-tests Trigger automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants