Skip to content

Conversation

@jaymcp
Copy link
Contributor

@jaymcp jaymcp commented Jun 13, 2024

Description

This PR adds documentation for the WordPress.DB.PreparedSQL sniff.

Related issues/external references

Part of #1722

@GaryJones
Copy link
Member

Have a look at some of the existing examples, such as in https://github.com/WordPress/WordPress-Coding-Standards/tree/develop/WordPress/Docs/Arrays to see how the <em> </em> tags are used to emphasise the key bit of the code examples.

@jaymcp
Copy link
Contributor Author

jaymcp commented Jun 20, 2024

Thanks @GaryJones, I've addressed the missing emphasis in fdd28c7.

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.

@jaymcp Hi Jay,

Thanks for working on this! Looking good!

I've gone through it with a critical eye and while the code samples were correct as they were, I have a feeling changing them a little would make the problem the sniff flags more obvious for people to grasp.

As, with the changes I made, some lines would become too long for code samples in docs, I've also broken up the SQL queries over multiple lines.

Let me know what you think about these suggestions.

jaymcp and others added 2 commits July 1, 2024 18:28
Rewrites code examples to be clearer, and adds highlighting. Props: @jrfnl

Co-authored-by: Juliette <[email protected]>
@jaymcp
Copy link
Contributor Author

jaymcp commented Jul 1, 2024

Thanks @jrfnl, I appreciate the thorough feedback. I have committed all of your suggestions 🙂

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.

Thanks for the update @jaymcp and sorry for my slow response.

All good now. As far as I'm concerned, this is ready for merge.

For whomever merges this: please squash-merge.

@dingo-d dingo-d merged commit 32fe3c4 into WordPress:develop Jul 23, 2024
@jaymcp jaymcp deleted the docs/WordPress.DB.PreparedSQL branch July 31, 2024 08:59
lesterchan added a commit to lesterchan/WordPress-Coding-Standards that referenced this pull request Jun 8, 2025
* upstream/develop: (428 commits)
  Rulesets: update schema URL
  GH Actions: use the xmllint-validate action runner and enhance checks (WordPress#2522)
  AbstractFunctionParameterSniff: fix first class callables and function imports (WordPress#2518)
  DontExtractStandard.xml file creation (WordPress#2456)
  Add documentation for WordPress.NamingConventions.ValidVariableName (WordPress#2457)
  Remove unused variables from a few sniffs (WordPress#2514)
  I18nTextDomainFixer: remove unnecessary variable initialization (WordPress#2513)
  GH Actions: Bump codecov/codecov-action from 4 to 5 (WordPress#2510)
  GH Actions: PHP 8.4 has been released
  CS/QA: remove redundant condition
  GH Actions: use explicit PHPStan major
  Various sniffs: simplify skipping the rest of the file
  GH Actions: always quote variables
  Release checklist: add new action item
  AbstractClassRestrictionsSniff: fix insufficient defensive coding (WordPress#2500)
  ✨ New WordPress.WP.GetMetaSingle sniff (WordPress#2465)
  Fix typo in AbstractFunctionRestrictionsSniff::is_targetted_token() DocBlock (WordPress#2477)
  Fix typos (WordPress#2472)
  Documentation: capitalization consistency fixes (WordPress#2469)
  [Documentation]: WordPress.DB.PreparedSQL (WordPress#2454)
  ...
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