WordPress PHP Coding Standards

In this lesson we learn about the WordPress Coding Standards.   These...

In this lesson we learn about the WordPress Coding Standards.  

These are guidelines and suggestions for how to write and format your PHP when working with WordPress.

You can access the WordPress PHP Coding Standards here: https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/

The WordPress Coding Standards contain information around the following topics:

  • Single and Double Quotes
  • Indentation
  • Brace Style
  • Use elseif, not else if
  • Regular Expressions
  • No Shorthand PHP Tags
  • Remove Trailing Spaces
  • Space Usage
  • Formatting SQL statements
  • Database Queries
  • Naming Conventions
  • Self-Explanatory Flag Values for Function Arguments
  • Interpolation for Naming Dynamic Hooks
  • Ternary Operator
  • Yoda Conditions
  • Clever Code
  • Error Control Operator @
  • Don’t extract()

Not all of these may make sense to you at this point so try taking a read through these now and check back on them again at different points in the course.