In this episode, you will learn why we use PHP as well as what it does. We’ll talk about what a programming language is. We’ll talk about its role in general terms. You’ll see that WordPress is built on PHP. That’s why each file has a
.php file extension on it.
PHP does the following for the web pages on our websites:
- Sends out to the browser
PHP figures out what the request is from the including URL that you want to view on the website. It loads all the code from files. It talks with the database to both write and get (read) dynamic content. It processes our requests like when you click on a form or link. You’ll find it throughout WordPress in all themes, plugins, and core.
Let’s talk about it.
Where does PHP run?
It runs on the web server where the website is hosted.
When does PHP run?
It runs when a PHP file is loaded into memory. Therefore, it runs when a web page request is received by the web server and WordPress starts up.
What is the first file that loads and runs when a typical web page request is received by the web server?
When the web server receives a web page request, the first file that loads into memory and runs is
index.php. That starts WordPress.
Why do we need to learn PHP?
Because WordPress is built on PHP. Every theme and plugin is built with PHP. If you want to contribute to Core, you need to know PHP. PHP is a vital component for developing and/or customizing WordPress websites.
Learning PHP, at least the barebones basics, will help you to read the code, recognize what is happening, and be able to do your work faster and better.
Who needs copy/paste? Right. Writing code from scratch is fun!
Total Lab Runtime: 03:21:32
- 1 Lab Introductionfree 11:37
- 2 What is PHP? Why use it?free 17:49
- 3 Why and how does WordPress use PHP?free 07:33
- 4 Syntax Basicsfree 18:34
- 5 What's the deal with Variables?free 27:05
- 6 Break Up Code into Logical Partsfree 07:55
- 7 Subroutines - Behold the functionfree 14:11
- 8 Loading Files to Runfree 13:20
- 9 To Run or Not to Run - Making Decisionsfree 19:07
- 10 Sequencing - Yup, code runs in orderfree 06:16
- 11 Repeating code using Loopsfree 13:57
- 12 Building Strings with Dots and Variablesfree 15:10
- 13 What's the deal with scope?free 08:34
- 14 Naming Stufffree 06:18
- 15 Putting it All Togetherfree 08:33
- 16 Where do I go from here?free 05:33