WordPress / WordPress/WordPress-Coding-Standards
Extra: sniff to check for usage of reserved words
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
WordPress has a list of words which are reserved for use as query vars.
See: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp.php#L18
If we can gather a list of functions in which these should not be used, I can imagine we could create a sniff to check against this.
One typical function in which they should not be used is register_taxonomy(), but I imagine there may be more functions in which these would lead to difficult to debug problems (with register_taxonomy() you end up with an unexplained 404).
Ref: https://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms
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 reviewing WordPress's reserved query-variable list in class-wp.php and the register_taxonomy() documentation linked in the issue. Identify which functions are in scope before defining the sniff; done means the supported reserved terms and affected functions are agreed and the sniff's expected checks are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100