PHP Course Table of Contents

What PHP Does

WordPress Folk Knowledge (to go somewhere): Basic WordPress debugging, and how to deactivate a plugin that’s breaking your site

  1. What PHP Is: A Programming Language that Outputs HTML
  2. What PHP Will Let You Do: Talk to WordPress’s PHP Architecture/Go “Under the Hood”
  3. Introduction to Servers and WordPress Architecture [https://courses.wpshout.com/uar-chapter/understanding-server-side-and-client-side-in-wordpress/ and https://courses.wpshout.com/uar-chapter/a-wordpress-lamp-an-introduction-to-wordpress-infrastructure/]
  4. Creating Your Sandbox: How to Set Up a WordPress Site Locally or Remotely [shill for SiteGround!]

Project: Get a WordPress instance running either locally or remotely

PHP Programming Fundamentals

Short Intro Chapter: You are about to learn the basic elements that let you put PHP on the page, and to start to work with variables and functions

  1. WordPress Folk Knowledge: Do It the WordPress Way (we’ll point you over to Up and Running often)
  1. Basics of PHP Syntax: the <?php Tag: [https://wpshout.com/learning-php-for-wordpress-development-how-to-include-php-in-html/]
  2. Basics of PHP Syntax: Comments
  3. Put Stuff on the Page: echo: [https://wpshout.com/learning-php-for-wordpress-development-understanding-phps-echo/]
    1. WordPress Folk Knowledge: Where All the HTML Is in WordPress
  4. Strings 102: Concatenating Strings [https://wpshout.com/php-concatenate-strings/]
  5. PHP Variables [https://wpshout.com/php-for-beginners-tutorial/ but needs edited/excerpted and needs to cover assignment ($me = ‘yes’) if it doesn’t]
  6. Key Data Types [https://wpshout.com/complete-guide-php-data-types-numbers-booleans-strings/]
  7. PHP Mathematical Operators (*, /, %, etc.) [https://wpshout.com/php-math-functions/ and include a short discussion of modulo from https://wpshout.com/php-modulo/]
  8. PHP Arrays [https://wpshout.com/thorough-introduction-php-arrays/]

Project: Write a PHP script that calls a function to do a calculation

Intermediate PHP Programming: Control Flow

Short Intro Chapter: You are about to learn a lot of topics that sum up to “control flow,” which is what makes PHP a programming language [https://wpshout.com/learning-php-for-wordpress-development-control-flow-basics/]

  1. PHP if()-statements [https://wpshout.com/learning-php-for-wordpress-development-control-flow-basics/ and include tips on writing good PHP conditionals from https://wpshout.com/three-tips-for-writing-airtight-php-conditions/; include two syntax options]
  2. PHP Logical Operators (==, ===, ||, !==, &&, etc.) [https://wpshout.com/php-logic-operators/]
  3. Introduction to PHP Functions [https://wpshout.com/learning-php-for-wordpress-development-introduction-to-php-functions/]
    1. WordPress Folk Knowledge: There’s a Function for That (e.g. wp_remote_get(), wp_mail(), get_template_part())
  4. Working with PHP Function Arguments (Including Default Values) [https://wpshout.com/learning-php-for-wordpress-development-introduction-to-php-functions/]
    1. WordPress Folk Knowledge: $args: Arrays of Function Arguments (because PHP is limited: you can’t have optional arguments/named parameters in PHP) – Functions Calling Functions (a function name string as a function arg)
  5. Introduction to PHP’s return:
    [https://wpshout.com/learning-php-for-wordpress-development-understanding-phps-return/, point over to the_() and get_the() template tags, talk about actions and filters]

    1. WordPress Folk Knowledge: Getting Used to Event-Driven Programming: Everything Touches Everything Else Uncomfortably
    2. WordPress Folk Knowledge: Turn echo into return with Output Buffering
  6. Loops: while() Loops [https://wpshout.com/learning-php-for-wordpress-development-while-loops/; include two syntax options; reference the Loop]
    1. WordPress Folk Knowledge: Go Learn Themes Now
  7. Loops: foreach() Loops [https://wpshout.com/php-foreach/, including discussion of rare use of for() loops; include two syntax options]
  8. Loops: early exit with break; and continue;
  9. Variable scope, focus mostly on “can’t call outside variables inside a function by default” [https://wpshout.com/php-globals-variable-scope-wordpress/]
    1. WordPress Folk Knowledge: Global State and Global Variables and Why They’re Bad But Used All the Time in WordPress (important ones like $post)
  10. include(), require_once(), and similar [reference get_template_part()]
    1. WordPress Folk Knowledge: Front Controllers: Why Nothing Lives in the Root
  11. Fun to Ignore: case : and switch : statements and why you should never create them yourself; closures and anonymous functions

OO PHP

  1. Introduction to OOPHP: [https://wpshout.com/courses/object-oriented-php-for-wordpress-developers/complete-guide-to-object-oriented-php/, will probably need to build out from there; also include conceptual intro from UaR at https://courses.wpshout.com/uar-chapter/the-concepts-of-object-oriented-php-you-need-to-understand-for-wordpress-development/]
    1. WordPress Folk Knowledge: Mmm, Spaghetti: Backwards-Compatibility, Technical Debt, and WordPress’s Diverse Codebase
  2. Private and public properties and methods in OOPHP [start with https://wpshout.com/courses/object-oriented-php-for-wordpress-developers/complete-guide-to-object-oriented-php/, build out from there]
  3. Class inheritance in OOPHP: [https://wpshout.com/courses/object-oriented-php-for-wordpress-developers/understanding-class-inheritance-child-and-parent-classes-in-object-oriented-php/]
  4. __construct(): [https://wpshout.com/courses/object-oriented-php-for-wordpress-developers/object-oriented-php-the-__construct-magic-method/]
  5. Other magic methods other than __construct()
  6. OOPHP and WordPress hooks: [https://wpshout.com/courses/object-oriented-php-for-wordpress-developers/wordpress-hooks-objects-where-how/]
  7. OOPHP and static methods: [https://wpshout.com/courses/object-oriented-php-for-wordpress-developers/php-static-methods-in-depth/]
  8. Describe using “fake namespaces” and say a few words about Composer autoloader