Best Practice – Code and formatting
CSS
Hypens, lower case, example: .btn-green or #sidebar-right
JS
Variable and function names should be full words, using camel case with a lowercase first letter.
Example: camelCase
PHP
Use lowercase letters in variable, action/filter, and function names (never camelCase
). Separate words via underscores. Don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
<?php function some_name( $some_variable ) {}