Skip to content

Instantly share code, notes, and snippets.

@phirebase
Last active January 26, 2025 13:45
Show Gist options
  • Save phirebase/22b9ff57f87960d55e12d949d11780e0 to your computer and use it in GitHub Desktop.
Save phirebase/22b9ff57f87960d55e12d949d11780e0 to your computer and use it in GitHub Desktop.
PHPCS and PHPCBF Commands for WordPress

PHPCS and PHPCBF Commands for WordPress

1️⃣ Run PHPCS

Use the phpcs command to analyze your code:

phpcs --standard=WordPress ./path/to/your/file.php

2️⃣ Optional: Automatic Fixes with PHPCBF

To fix simple coding standard issues automatically, use:

phpcbf --standard=WordPress ./path/to/your/file.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment