This page covers how to use PHP with WordPress. It may cover some general topics but will focus on PHP as used in WP primarily.
Table Of Contents
General
- David Hayes. A Thorough Introduction to PHP Arrays. wpshout, 2019.
- Leonardo Losoviz. Improving WordPress Code with Modern PHP. Smashing Magazine, 2019.
- Covers briefly classes, namespaces, traits, interfaces, closures, generators, argument and return type declarations, spread operator, null coalescing operator, spaceship operator.
- Gordan. PHP Namespaces for WordPress – a No Nonsense Guide. 2018.
- Tom McFarlin. A Primer on Reflection in PHP (and How it Plays into Unit Testing). 2018.
- David Hayes. A Complete Guide to PHP Data Types: Numbers, Booleans, Strings, & More. wpshout, 2018.
- Josh Pollock. A WordPress Developers Guide to Type Hinting in PHP 5 and 7. torque, 2016.
- Josh Pollock. PHP Fundamentals for WordPress Developers. torque, 2016.
- Fred Meyer, David Hayes. Learn PHP for WordPress Development. wpshout, 2019.
- Rachel Andrew. A Guide to PHP Error Messages for Designers. smashing magazine, 2011.
- David Hayes. The Many Uses of PHP Output Buffering in WordPress. wpshout, 2018.
- Fred Meyers. Three Tips for Writing Airtight PHP Conditions. wpshout, 2019.
- Josh Pollock. Understanding Copies & References in PHP. torque, 2016.
- Josh Pollock. What WordPress Developers Need to Know About PHP Magic Methods. torque, 2016.
OOP
- Fred Meyer. Object-Oriented PHP for WordPress Developers. wpshout, 2018-2019.
- 1. Object-Oriented Programming as Paradigm.
- 2. Introduction to Object Oriented PHP for WordPress Developers.
- 3. Understanding Class Inheritance in PHP.
- 4. The __construct() Maghic Method.
- 5. How to Combine Object-Oriented Code with WordPress’s Hooks System.
- 6. Introduction to Static Methods.
PHP 7
- Carlo Daniele. What’s New in PHP 7.4 (Features, Deprecations, Speed). kinsta, 2019.
- Alyssa Cuda. A First Look at PHP 7.4. wpengine, 2019.
- Carlo Daniele. What’s New in PHP 7.3. kinsta, 2019.
- Josh Pollock. What WordPress Developers Need to Know About PHP 7.2. torque, 2017.
- Carlo Daniele. What’s New in PHP 7.2. kinsta, 2018.
- Daniel Pataki. What’s New in PHP 7.1.0. kinsta, 2019.
- David Hayes. Cool New PHP 7 Features for WordPress Developers. wpshout, 2019.
- Josh Pollock. An Introduction to Return Type Declarations in PHP7. torque, 2016.
- Tom Ewer. An Introduction to PHP 7 for WordPress Users. torque, 2016.
Functional
- David Hayes. Gentle Introduction to Functional PHP for WordPress Developers: Using Filter and Map on Arrays of Posts. wpshout, 2016.
Useful PHP
- PCRE (Perl Compatible Regular Expressions) Functions
- preg_filter() – search and replace
- preg_grep() – array of entries matching pattern
- preg_replace() – search and replace
- String Functions
- DOM Manipulation
- Abhinav R. Parsing HTML in PHP using Native Classes. coral nodes, 2019.
- Other Functions
- spl_autoload() – For autoloading.
- uniqid() – Generate a semi-unique id using current time in milliseconds.