<!-- Generated by SpecStory, Markdown v2.1.0 -->

# 2026-01-16 17:19:36Z

<!-- cursoride Session 5ee8dfe3-1dd3-4853-9bf2-3089274a18d7 (2026-01-16 17:19:36Z) -->

_**User (2026-01-16 17:19:23Z)**_

@includes/widget/class-widget-address.php this widget usually has checkboxes near addresses to let me choose which one to display in the widget on the front-end. i am not seeing that. here's the markup that lists the 1 address but there's no way to choose it. do you know what has degraded or why I can't see the checkbox? don't make any changes.

<div class="wp-block-legacy-widget__edit-form"><h3 class="wp-block-legacy-widget__edit-form-title">Address</h3><div class="widget open"><div class="widget-inside"><form class="form" method="post"><input class="widget-id" type="hidden" name="widget-id" value="_invp_address-6"><input class="id_base" type="hidden" name="id_base" value="_invp_address"><input class="widget-width" type="hidden" name="widget-width" value="250"><input class="widget-height" type="hidden" name="widget-height" value="200"><input class="widget_number" type="hidden" name="widget_number" value="6"><div class="widget-content"><p>
		<label for="widget-_invp_address-6-title">Title:</label>
		<input class="widefat" id="widget-_invp_address-6-title" name="widget-_invp_address[6][title]" type="text" value="">
		</p>
		<p>
		<input type="checkbox" id="widget-_invp_address-6-cb_single_line" name="widget-_invp_address[6][cb_single_line]" value="true">
		<label for="widget-_invp_address-6-cb_single_line">Single Line Display</label>
		</p>
		<p></p><table><tbody><tr><td colspan="2">Select Addresses to Display</td></tr><tr><td></td><td>480 N. Reading Road<br>
Ephrata, PA 17522</td></tr></tbody></table><p></p></div></form></div></div></div>

_**User (2026-01-16 17:19:23Z)**_

did you get stuck?

---

_**Agent (default)**_

Investigating why the checkboxes aren't rendering. Examining the widget code:


_**Agent (default)**_

<tool-use data-tool-type="read" data-tool-name="read_file">
<details><summary>Tool use: **read_file** • Read file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/widget/class-widget-address.php</summary>

</details>
</tool-use>

<tool-use data-tool-type="read" data-tool-name="read_file"><details>
<summary>Tool use: **read_file**</summary>

</details></tool-use>

_**Agent (default)**_

The issue is on line 146: `wp_kses_post()` is used to output the table HTML, and it strips `<input>` elements because they aren't allowed in post content.

The checkbox is built correctly (lines 124-130), but when the table is output via `wp_kses_post()` on line 146, the `<input type="checkbox">` tags are removed, leaving an empty `<td>`.

**The problem:** `wp_kses_post()` removes form input elements, so the checkboxes are stripped during sanitization.

**The solution:** Use a different sanitization method that allows form inputs, or build the table HTML differently. For example, you could:
- Use `wp_kses()` with a custom allowed HTML array that includes input elements
- Output the checkbox HTML directly without wrapping it in the sanitized string
- Use a different approach that doesn't require sanitizing the entire table string

The checkbox code itself (lines 124-131) looks correct; the sanitization on line 146 is removing it.

---

_**User (2026-01-16 17:19:23Z)**_

let's change that call on 146 to use wp_kses()

---

_**Agent (default)**_

Updating line 146 to use `wp_kses()` with an allowed HTML array that includes input elements:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/widget/class-widget-address.php</summary>

**Chunk 1**
Lines added: 19, lines removed: 1

```diff
@@ -144,5 +144,23 @@
  		&lt;label for="&lt;?php echo esc_attr( $this-&gt;get_field_id( 'cb_single_line' ) ); ?&gt;"&gt;&lt;?php esc_html_e( 'Single Line Display', 'inventory-presser' ); ?&gt;&lt;/label&gt;
  		&lt;/p&gt;
- 		&lt;p&gt;&lt;?php echo wp_kses_post( $address_table ); ?&gt;&lt;/p&gt;
+ 		&lt;p&gt;&lt;?php
+ 		echo wp_kses(
+ 			$address_table,
+ 			array(
+ 				'table' =&gt; array(),
+ 				'tbody' =&gt; array(),
+ 				'tr'    =&gt; array(),
+ 				'td'    =&gt; array( 'colspan' =&gt; array() ),
+ 				'input' =&gt; array(
+ 					'type'    =&gt; array(),
+ 					'id'      =&gt; array(),
+ 					'name'    =&gt; array(),
+ 					'value'   =&gt; array(),
+ 					'checked' =&gt; array(),
+ 				),
+ 				'br'    =&gt; array(),
+ 			)
+ 		);
+ 		?&gt;&lt;/p&gt;
  		&lt;?php
  	}
```

</details>

</tool-use>

<tool-use data-tool-type="write" data-tool-name="search_replace"><details>
<summary>Tool use: **search_replace**</summary>

</details></tool-use>

_**Agent (default)**_

<tool-use data-tool-type="unknown" data-tool-name="read_lints">
<details>
<summary>Tool use: **read_lints**</summary>


Parameters:

```json
{
  "paths": [
    "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/widget/class-widget-address.php"
  ]
}
```
Result:

```json
{
  "linterErrorsByFile": [
    {
      "errors": [
        {
          "isStale": false,
          "message": "Class file names should be based on the class name with \"class-\" prepended. Expected class-inventory-presser-location-address.php, but found class-widget-address.php.",
          "range": {
            "endPosition": {
              "column": 2,
              "line": 1
            },
            "startPosition": {
              "column": 1,
              "line": 1
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Missing file doc comment",
          "range": {
            "endPosition": {
              "column": 2,
              "line": 1
            },
            "startPosition": {
              "column": 1,
              "line": 1
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "End of line character is invalid; expected \"\\n\" but found \"\\r\\n\"",
          "range": {
            "endPosition": {
              "column": 2,
              "line": 1
            },
            "startPosition": {
              "column": 1,
              "line": 1
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Visibility must be declared on method \"__construct\"",
          "range": {
            "endPosition": {
              "column": 10,
              "line": 23
            },
            "startPosition": {
              "column": 2,
              "line": 23
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Doc comment short description must start with a capital letter",
          "range": {
            "endPosition": {
              "column": 18,
              "line": 37
            },
            "startPosition": {
              "column": 5,
              "line": 37
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Missing parameter comment",
          "range": {
            "endPosition": {
              "column": 11,
              "line": 50
            },
            "startPosition": {
              "column": 5,
              "line": 50
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Missing parameter comment",
          "range": {
            "endPosition": {
              "column": 11,
              "line": 51
            },
            "startPosition": {
              "column": 5,
              "line": 51
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Loose comparisons are not allowed. Expected: \"===\"; Found: \"==\"",
          "range": {
            "endPosition": {
              "column": 84,
              "line": 65
            },
            "startPosition": {
              "column": 79,
              "line": 65
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_WARNING"
        },
        {
          "isStale": false,
          "message": "Use Yoda Condition checks, you must.",
          "range": {
            "endPosition": {
              "column": 84,
              "line": 65
            },
            "startPosition": {
              "column": 79,
              "line": 65
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Loose comparisons are not allowed. Expected: \"!==\"; Found: \"!=\"",
          "range": {
            "endPosition": {
              "column": 58,
              "line": 68
            },
            "startPosition": {
              "column": 57,
              "line": 68
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_WARNING"
        },
        {
          "isStale": false,
          "message": "Missing parameter comment",
          "range": {
            "endPosition": {
              "column": 11,
              "line": 90
            },
            "startPosition": {
              "column": 5,
              "line": 90
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "If control structure block found as the only statement within an \"else\" block. Use elseif instead.",
          "range": {
            "endPosition": {
              "column": 12,
              "line": 108
            },
            "startPosition": {
              "column": 11,
              "line": 108
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Loose comparisons are not allowed. Expected: \"===\"; Found: \"==\"",
          "range": {
            "endPosition": {
              "column": 44,
              "line": 110
            },
            "startPosition": {
              "column": 43,
              "line": 110
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_WARNING"
        },
        {
          "isStale": false,
          "message": "Not using strict comparison for in_array; supply true for $strict argument.",
          "range": {
            "endPosition": {
              "column": 38,
              "line": 129
            },
            "startPosition": {
              "column": 26,
              "line": 129
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_WARNING"
        },
        {
          "isStale": false,
          "message": "Opening PHP tag must be on a line by itself",
          "range": {
            "endPosition": {
              "column": 13,
              "line": 146
            },
            "startPosition": {
              "column": 12,
              "line": 146
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Line indented incorrectly; expected at least 2 tabs, found 2",
          "range": {
            "endPosition": {
              "column": 10,
              "line": 163
            },
            "startPosition": {
              "column": 9,
              "line": 163
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Line indented incorrectly; expected 3 tabs, found 2",
          "range": {
            "endPosition": {
              "column": 10,
              "line": 164
            },
            "startPosition": {
              "column": 9,
              "line": 164
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Closing PHP tag must be on a line by itself",
          "range": {
            "endPosition": {
              "column": 10,
              "line": 164
            },
            "startPosition": {
              "column": 9,
              "line": 164
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Missing parameter comment",
          "range": {
            "endPosition": {
              "column": 11,
              "line": 171
            },
            "startPosition": {
              "column": 5,
              "line": 171
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        },
        {
          "isStale": false,
          "message": "Missing parameter comment",
          "range": {
            "endPosition": {
              "column": 11,
              "line": 172
            },
            "startPosition": {
              "column": 5,
              "line": 172
            }
          },
          "severity": "DIAGNOSTIC_SEVERITY_ERROR"
        }
      ],
      "relativeWorkspacePath": "includes/widget/class-widget-address.php"
    }
  ],
  "path": "/Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/widget/class-widget-address.php"
}
```
Status: **completed**


</details>
</tool-use>

<tool-use data-tool-type="unknown" data-tool-name="read_lints"><details>
<summary>Tool use: **read_lints**</summary>

</details></tool-use>

_**Agent (default)**_

Fixing the formatting issue introduced by the change:


_**Agent (default)**_

<tool-use data-tool-type="write" data-tool-name="search_replace">

<details><summary>Tool use: **search_replace** • Edit file: /Users/Prytania/Dropbox/WordPress/Inventory Presser/plugins/inventory-presser/includes/widget/class-widget-address.php</summary>

**Chunk 1**
Lines added: 2, lines removed: 1

```diff
@@ -144,5 +144,6 @@
  		&lt;label for="&lt;?php echo esc_attr( $this-&gt;get_field_id( 'cb_single_line' ) ); ?&gt;"&gt;&lt;?php esc_html_e( 'Single Line Display', 'inventory-presser' ); ?&gt;&lt;/label&gt;
  		&lt;/p&gt;
- 		&lt;p&gt;&lt;?php
+ 		&lt;p&gt;
+ 		&lt;?php
  		echo wp_kses(
  			$address_table,
```

**Chunk 2**
Lines added: 2, lines removed: 1

```diff
@@ -162,5 +163,6 @@
  			)
  		);
- 		?&gt;&lt;/p&gt;
+ 		?&gt;
+ 		&lt;/p&gt;
  		&lt;?php
  	}
```

</details>

</tool-use>

<tool-use data-tool-type="write" data-tool-name="search_replace"><details>
<summary>Tool use: **search_replace**</summary>

</details></tool-use>

_**Agent (default)**_

Updated line 146 to use `wp_kses()` with an allowed HTML array that includes `input` elements. This preserves the checkboxes instead of stripping them.

The allowed HTML array includes:
- `table`, `tbody`, `tr`, `td` (table structure)
- `input` with `type`, `id`, `name`, `value`, and `checked` attributes (checkboxes)
- `br` (address line breaks)

The checkboxes should now appear in the widget admin form. The other linting errors are pre-existing code style issues and not related to this change.
