Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
PHP Coding Standards for WordPress1:24 with Zac Gordon
WordPress has official documentation for how you should code your PHP for WordPress plugins and themes. These coding standards also apply to Core itself. As you continue on to learn more PHP, make sure to take the time to study these coding standards.
Before we close out our course here on PHP for WordPress,
I wanna talk about one last thing, and that is the WordPress Coding Standards.
On the WordPress Codex they have a section for coding standards and
These are opinionated ways to go about coding in these particular languages.
Let's go ahead and jump into the PHP coding standards.
When you start looking at PHP in more depth,
you'll find out that there are different ways to do things.
For example using single quotes versus double quotes for
strings, or how to indent things.
Word Press has an opinionated way to approach this, and this allows for
consistency between themes and plug-ins, as well as the WordPress core.
I suggest that as you go about learning PHP in more depth,
you also take the time to look through the WordPress coding standards for PHP.
And sync up what you've been learning and accommodate it to WordPress specifically.
There's not a whole lot here.
And as you learn PHP, the stuff should make pretty good sense.
Again, if you're going to approach PHP in WordPress,
you might as well do it the right way from the beginning and learn about how they
want you to approach doing certain things in the WordPress environment.
You need to sign up for Treehouse in order to download course files.Sign up