Skip to content

Commit f507cc9

Browse files
dgershmanclaude
andauthored
Add usage/help section to NACC settings page (#27)
Surface how to use the plugin directly on the Settings → NACC admin page (closes #26): - "How to Use" section explaining the [nacc] shortcode and that the settings on the page are the site-wide defaults. - Shortcode attribute table (theme, language, layout, special) mirroring README.md, noting attributes override the saved defaults per-instance. - One-line description of each control (Theme / Language / Layout / Show Special Keytags). - Link to the bundled nacc2/README.md for standalone (non-WordPress) usage. Bump version to 6.0.2 and add a readme.txt changelog entry. Help copy is mirrored from README.md / nacc2/README.md; escaping matches the existing draw_settings() conventions (static markup + esc_url for the README link). 🐦‍⬛ Generated with Claude Code, orchestrated by Crow Crow-Session: 065EC34B-D2C2-46A1-899B-EDFE29AEA7CD Co-authored-by: Claude <noreply@anthropic.com>
1 parent b9fd5d6 commit f507cc9

2 files changed

Lines changed: 71 additions & 2 deletions

File tree

nacc-wordpress-plugin.php

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Install: Drop this directory in the "wp-content/plugins/" directory and activate it. You need to specify "[NACC]" in the code section of a page or a post.
77
* Contributors: BMLTGuy, pjaudiomv, bmltenabled
88
* Authors: bmltenabled
9-
* Version: 6.0.1
9+
* Version: 6.0.2
1010
* Requires PHP: 8.0
1111
* Requires at least: 5.3
1212
* License: GPL v2 or later
@@ -464,6 +464,71 @@ public static function draw_settings(): void {
464464
</table>
465465
<?php submit_button(); ?>
466466
</form>
467+
468+
<hr />
469+
470+
<h2>How to Use</h2>
471+
<p>
472+
Add the <code>[nacc]</code> shortcode to any page or post to embed the cleantime
473+
calculator. The settings above are the site-wide defaults used whenever the
474+
shortcode is placed without attributes.
475+
</p>
476+
477+
<h3>Shortcode Attributes</h3>
478+
<p>
479+
All attributes are optional. Any attribute you set on the shortcode overrides the
480+
saved default above for that instance only, so you can display the calculator
481+
differently on different pages.
482+
</p>
483+
<table class="widefat striped" style="max-width: 40em;">
484+
<thead>
485+
<tr>
486+
<th scope="col">Attribute</th>
487+
<th scope="col">Values</th>
488+
<th scope="col">Default</th>
489+
</tr>
490+
</thead>
491+
<tbody>
492+
<tr>
493+
<td><code>theme</code></td>
494+
<td>See the Theme dropdown above</td>
495+
<td>Default (gray)</td>
496+
</tr>
497+
<tr>
498+
<td><code>language</code></td>
499+
<td>See the Language dropdown above</td>
500+
<td><code>en</code></td>
501+
</tr>
502+
<tr>
503+
<td><code>layout</code></td>
504+
<td><code>linear</code>, <code>tabular</code></td>
505+
<td><code>linear</code></td>
506+
</tr>
507+
<tr>
508+
<td><code>special</code></td>
509+
<td><code>1</code>, <code>0</code></td>
510+
<td><code>0</code></td>
511+
</tr>
512+
</tbody>
513+
</table>
514+
<p>
515+
Example:
516+
<code>[nacc theme="NACC-BT" language="es" layout="tabular" special="1"]</code>
517+
</p>
518+
519+
<h3>What Each Setting Does</h3>
520+
<ul class="ul-disc">
521+
<li><strong>Theme</strong> &mdash; the visual style (color scheme) of the keytags.</li>
522+
<li><strong>Language</strong> &mdash; the language of the keytag labels and cleantime summary.</li>
523+
<li><strong>Layout</strong> &mdash; <code>linear</code> shows tag fronts in a single row; <code>tabular</code> shows the tags side-by-side with their rear text.</li>
524+
<li><strong>Show Special Keytags</strong> &mdash; whether the "specialty" long-term tags (over 2 years, e.g. the Decades tag) are displayed.</li>
525+
</ul>
526+
527+
<p>
528+
For standalone (non-WordPress) usage, see the
529+
<a href="<?php echo esc_url( plugins_url( 'nacc2/README.md', __FILE__ ) ); ?>">nacc2/README.md</a>
530+
documentation included with this plugin.
531+
</p>
467532
</div>
468533
<?php
469534
}

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Plugin URI: https://wordpress.org/plugins/nacc-wordpress-plugin/
55
Tags: na, cleantime calculator, nacc, recovery, addiction
66
Requires PHP: 8.0
77
Tested up to: 7.0
8-
Stable tag: 6.0.1
8+
Stable tag: 6.0.2
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -30,6 +30,10 @@ That text will be replaced with this cleantime calculator.
3030

3131
== Changelog ==
3232

33+
= 6.0.2 =
34+
35+
* Added a "How to Use" help section to the Settings → NACC admin page documenting the `[nacc]` shortcode, its attributes, and what each setting does.
36+
3337
= 6.0.1 =
3438

3539
* Added a "Lantern" theme matching the Lantern WordPress theme (warm parchment paper, deep ink navy, terracotta ember accents, Fraunces display serif for the cleantime number). Selectable from Settings → NACC → Theme.

0 commit comments

Comments
 (0)