Chapter 12. PHP Libraries, External APIs, and Web Services

Most programming languages, including PHP, have modularized collections of code, classes, and functions. These collections are usually referred to as a code library or extension. Don’t recreate the wheel. There are PHP libraries that exist to perform very specific functionality that can be easily used to extend the applications you are building.

Most of WordPress is written in PHP, which means as a WordPress developer, you can utilize any PHP libraries available to you or even build your own! Check out the PHP.net Function Reference for an organized list of some PHP libraries.

An application programmable interface, or API, can be part of an application in which you have access to the source code, like the various WordPress APIs covered in this book. But an API can also enable you to use an application or service in which you don’t have direct access to the source code. Many web-based applications and services offer some kind of API for accessing or manipulating their data from your application.

The WordPress plugin repository has more than a few plugins that interact with various web services, so any time you are looking for custom WordPress functionality, you might want to start at the WordPress plugin repository. Of course, if you don’t find exactly what you are looking for in a plugin, you may need to write your own custom plugin or piggyback off of an existing one.

We mentioned GitHub more than a few times, but it is a great ...

Get Building Web Apps with WordPress now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.