Commit 9c18fef
fix(phase6): Update WordPress 6.5+ standards and standardize text domains
## Critical Issues Fixed
### Issue #4: WordPress 6.5+ Block Rendering Standards
- **block-json.instructions.md**: Enhanced dynamic block rendering documentation
- Added "WordPress 6.5+ File-based Rendering (RECOMMENDED)" section
- Positioned `"render": "file:./render.php"` as PRIMARY method
- Documented automatic variables ($attributes, $content, $block)
- Added proper mustache placeholder example with {{namespace}} and {{slug}}
- Created "Legacy PHP Callback" section for pre-6.5 compatibility
- Added Version Compatibility Matrix (6.5+, 6.0-6.4, <6.0)
- Clarified scaffold standard: Always use file-based rendering
### Issue #5: Text Domain Standardization
- **wpcs-php.instructions.md**: Standardized all text domain examples
- Changed 'textdomain' to '{{textdomain}}' in all i18n examples (8 instances)
- Changed 'lsx-theme' to '{{textdomain}}' in translation guidance (line 390)
- Added explanatory note about placeholder vs production usage
- Ensures AI agents copy correct mustache placeholders
## Changes Made
### block-json.instructions.md
- Lines 305-367: Complete rewrite of "Render Callback" section
- Added 3 subsections: Recommended, Legacy, Version Compatibility
- Enhanced render.php example with proper @var annotations
- Included WP_Block context usage example
- Clear deprecation warning for render_callback approach
### wpcs-php.instructions.md
- Lines 121-122: Updated wp_die() text domains
- Lines 297-300: Updated core i18n function examples
- Lines 307-308: Updated wp_localize_script() string examples
- Line 390: Updated translation guidance with placeholder explanation
- Line 295: Added note explaining {{textdomain}} placeholder convention
## Impact
### Before:
- Unclear if file-based rendering or PHP callbacks were preferred
- Text domain examples used inconsistent values ('textdomain', 'lsx-theme', 'plugin')
- AI agents might copy wrong text domain into scaffold templates
### After:
- Clear WordPress 6.5+ standard with file-based rendering as PRIMARY method
- All examples consistently use '{{textdomain}}' placeholder
- Explicit note explaining placeholder vs production usage
- Version compatibility matrix guides decision-making
## Validation
✅ File-based rendering positioned as WordPress 6.5+ standard
✅ All text domain examples now use {{textdomain}} placeholder
✅ Backward compatibility documented for legacy WordPress versions
✅ Clear guidance prevents text domain mistakes in scaffold
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 12ac0f7 commit 9c18fef
File tree
2 files changed
+54
-18
lines changed- .github/instructions
2 files changed
+54
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
308 | 310 | | |
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
315 | 322 | | |
316 | 323 | | |
317 | 324 | | |
318 | | - | |
| 325 | + | |
319 | 326 | | |
320 | | - | |
321 | | - | |
322 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
323 | 331 | | |
324 | | - | |
325 | | - | |
326 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
327 | 352 | | |
328 | | - | |
329 | | - | |
| 353 | + | |
330 | 354 | | |
331 | 355 | | |
332 | 356 | | |
333 | 357 | | |
334 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
335 | 369 | | |
336 | 370 | | |
337 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
| 121 | + | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
301 | 303 | | |
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
307 | | - | |
308 | | - | |
| 309 | + | |
| 310 | + | |
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
| |||
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
390 | | - | |
| 392 | + | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| |||
0 commit comments