[Update] Add WP DiscouragedConstants standard doc#2589
Closed
paulopmt1 wants to merge 2 commits intoWordPress:developfrom
Closed
[Update] Add WP DiscouragedConstants standard doc#2589paulopmt1 wants to merge 2 commits intoWordPress:developfrom
paulopmt1 wants to merge 2 commits intoWordPress:developfrom
Conversation
jrfnl
reviewed
Aug 26, 2025
Member
jrfnl
left a comment
There was a problem hiding this comment.
@paulopmt1 Thank you for working on this documentation! Looking good.
Two small remarks:
- I wonder if it would make sense to combine the current code samples into one
<code_comparison>as they are basically demonstrating the same thing (use of discouraged constant). - I also wonder whether there should be a code sample demonstrating that (re-)declaring the constants is discouraged.
I imagine that may warrant it's own<code_comparison>block and possibly its own<standard>block. (also see my suggestion inline).
| > | ||
| <standard> | ||
| <![CDATA[ | ||
| The use of certain WordPress constants is discouraged. Examples include `TEMPLATEPATH` and `STYLESHEETPATH`. |
Member
There was a problem hiding this comment.
Suggested change
| The use of certain WordPress constants is discouraged. Examples include `TEMPLATEPATH` and `STYLESHEETPATH`. | |
| The use and (re-)declaration of certain WordPress native constants is discouraged. Examples include `TEMPLATEPATH` and `STYLESHEETPATH`. |
Comment on lines
+23
to
+27
| <standard> | ||
| <![CDATA[ | ||
| The use of certain WordPress constants is discouraged. Examples include `TEMPLATEPATH` and `STYLESHEETPATH`. | ||
| ]]> | ||
| </standard> |
Member
There was a problem hiding this comment.
Duplicate <standard> block is unnecessary.
A <standard> can have multiple <code_comparison> blocks associated with it, so this block should be removed.
Collaborator
|
@paulopmt1, I was just wondering if you'll have a chance to finish this off in the near future. It would be great if this PR could be included in the next WPCS release. If you haven't got time or lost interest, please let us know and we'll see if we can find someone to take over. Thanks! |
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.
Related to #1722
Surpases RafaelFunchal's change made here: #2493
Closes #2493