Add allow_special mode to fully disable specialty keytags (#25)#29
Merged
Merged
Conversation
dgershman
force-pushed
the
feature/nacc-25-disable-specialty-keytags
branch
from
July 17, 2026 00:50
012397e to
a4f348d
Compare
Adds a way for admins to hide the in-widget specialty-keytags toggle entirely, rather than only controlling its initial state. JS (nacc2/src/nacc.js): new 7th constructor param `allowSpecialTags` (default true for back-compat). When false, `showSpecialTags` is forced off, `localStorage['nacc_keytag_special']` and the `NACC-special-tags` GET param are ignored, and the specialTagsCheckbox/specialTagsLabel are not created. Bundle rebuilt via vite. PHP: new `nacc_allow_special` boolean setting (default true) with a "Allow visitors to toggle specialty keytags" checkbox on Settings → NACC, a matching `allow_special` shortcode attribute wired through both the standard and legacy shortcode paths, and a 7th arg passed to the JS constructor in render_keytags(). Defaults preserve today's behavior. readme.txt: documented the `allow_special` attribute, added a 6.1.0 changelog entry, and bumped Stable tag / plugin Version to 6.1.0. 🐦⬛ Generated with Claude Code, orchestrated by Crow Co-Authored-By: Claude <noreply@anthropic.com> Crow-Session: 07A468E3-CCEB-4179-A9CC-9F057528235C Claude-Session: https://claude.ai/code/session_01KgsQa1xaRefJi29WCZzbQq
dgershman
force-pushed
the
feature/nacc-25-disable-specialty-keytags
branch
from
July 17, 2026 00:53
a4f348d to
69c8ad9
Compare
pjaudiomv
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #25
What
Adds a mode where specialty/long-term keytags are fully disabled — the in-widget toggle checkbox/label are not rendered and the visitor's saved preference is ignored — rather than the admin setting only controlling the initial state.
Changes
JS (
nacc2/src/nacc.js)allowSpecialTags(defaulttrue, back-compat). Whenfalse:showSpecialTagsis forced off,localStorage['nacc_keytag_special']and theNACC-special-tagsGET param are ignored (a prior visitor toggle or URL param can't re-enable),specialTagsCheckbox/specialTagsLabelare not created (the layout toggle still renders).nacc2/nacc.jsrebuilt via vite.PHP (
nacc-wordpress-plugin.php)nacc_allow_specialboolean setting (defaulttrue) + a "Allow Visitors To Toggle Specialty Keytags" checkbox on Settings → NACC.allow_specialshortcode attribute (e.g.[nacc allow_special="0"]), wired through both the standard (trigger_after_shortcode_loaded) and legacy (nacc_content) paths and passed as the 7th JS constructor arg inrender_keytags().readme.txt— documented theallow_specialattribute, added a6.0.2changelog entry, bumped Stable tag + plugin Version to6.0.2.Design / composition with siblings (#24, #26)
Chose the "second checkbox" / dedicated
allowSpecialTagsparam approach (which the ticket lists as acceptable) rather than folding a 3-way select intonacc_special. This deliberately leavesnacc_specialand its default-state handling untouched so it composes cleanly with #24 (the default-state fix) instead of reimplementing that logic — the new "allow" flag layers strictly on top.readme.txt/ version bump: per the ticket comment, the version + changelog are shared across Specialty keytags show by default even when the setting is unchecked #24/Allow admins to disable specialty keytags entirely (hide the toggle) #25/Add usage documentation to the NACC settings page #26. I made the smallest correct entry and bumped to6.0.2. Reviewer: please manage the combined bump — Specialty keytags show by default even when the setting is unchecked #24/Add usage documentation to the NACC settings page #26 should land under this same6.0.2rather than bumping again (avoid a double-bump).Verification
npm run build(vite) — bundle regenerated;npm run format:check+npm run lintclean.php -lclean;phpcs(.phpcs.xml) exit 0.allowSpecialTags = c !== false, checkbox creation gated behindthis.allowSpecialTags, and the false branch forcesshowSpecialTagsoff.🤖 Generated with Claude Code
https://claude.ai/code/session_01KgsQa1xaRefJi29WCZzbQq