Skip to content

Instantly share code, notes, and snippets.

@yasershahi
Created December 22, 2024 19:22
Show Gist options
  • Save yasershahi/3ab5f4d3a9506f0abb7c3194c5f8028e to your computer and use it in GitHub Desktop.
Save yasershahi/3ab5f4d3a9506f0abb7c3194c5f8028e to your computer and use it in GitHub Desktop.
WordPress Coding Standards in VS Code

You need Composer on your system: Install

Install WordPessCS

CD to your project root and run:

composer require --dev wp-coding-standards/wpcs

Configure VS Code

Install the PHP Sniffer & Beautifier extension. Open VS Code’s settings.json and add:

"[php]": {
    "editor.defaultFormatter": "valeryanm.vscode-phpsab",
    "editor.formatOnSave": true
}

also

"phpsab.standard": "WordPress"

Source: Edmund Chan

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