Skip to content

Conversation

@paulopmt1
Copy link

@paulopmt1 paulopmt1 commented Aug 26, 2025

Related to #1722

Surpases RafaelFunchal's change made here: #2493

image

Closes #2493

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate <standard> block is unnecessary.

A <standard> can have multiple <code_comparison> blocks associated with it, so this block should be removed.

@jrfnl jrfnl changed the title Add DiscouragedConstants standard doc [Update] Add WP DiscouragedConstants standard doc Aug 26, 2025
@jrfnl jrfnl mentioned this pull request Aug 26, 2025
61 tasks
@rodrigoprimo
Copy link
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants