WordPress / WordPress/WordPress-Coding-Standards
report missing context for _x
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
_x( 'foo', '', 'bar' )
If the context of _x is empty, output an error message:
"Do not use _x with empty context. Use __() instead"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the sniff that analyzes _x() calls and any tests covering translation-context validation. Reproduce the empty-context example from the issue, then add coverage confirming that it reports the requested message while non-empty contexts remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- localization, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100