Hide table columns that are empty for every row - #9
Merged
Conversation
Email suppression is on by default, so [procore_team] rendered an Email header above a blank cell for every member. On a default install that is visible dead weight on the most commonly used shortcode. Columns that render nothing for any row are now dropped before the table is built. That also covers a column no record happens to populate — a description or phone nobody has filled in — and the filter never reduces a table to no columns at all. Found by standing up a real WordPress site, serving it over HTTP and reading what a visitor actually receives, rather than by asserting on strings. The served markup was: headers: Name | Role | Company | Email email cells: 4 total, 0 non-empty and is now: headers: Name | Role | Company Two tests cover it: the column disappears when suppressed, and survives when both email opt-ins are on. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Found by standing up a real WordPress site with the published v2.0.4 ZIP, serving it over HTTP, and reading what a visitor actually receives.
The problem
Email suppression is on by default, so
[procore_team]rendered this:An Email header above a blank cell for every member — visible dead weight on the most commonly used shortcode, on every default install.
The fix
Columns that render nothing for any row are dropped before the table is built. Now:
This also covers a column no record happens to populate, and the filter never reduces a table to no columns at all.
Tests
Two: the column disappears when email output is suppressed, and survives when both opt-ins are on. 103 tests, 390 assertions. PHPCS clean.
What else the test site showed
Everything else held up. Verified over real HTTP, not by asserting on strings:
admin-ajax.phpwith a real nonce — 6/6 stages, 16/16 endpoints readable-1; no cookie →0I also chased two false alarms to ground rather than reporting them: a stylesheet that looked like it loaded on a plain page (wrong page was being served) and an apparent token leak on the Status screen (the admin bar showing the username
demo, which collided with my mock token value).🤖 Generated with Claude Code