Happy coding!
Joost de Valk
Yoast.com
Copyright © 2020 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada and the United Kingdom
ISBN: 978-1-119-66694-3
ISBN: 978-1-119-66697-4 (ebk)
ISBN: 978-1-119-66693-6 (ebk)
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at www.wiley.com/go/permissions
.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at booksupport.wiley.com
. For more information about Wiley products, visit www.wiley.com
.
Library of Congress Control Number: 2020935186
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. WordPress is a registered trademark of WordPress Foundation Corporation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
To my son, Lucas Royce Williams, for reminding me to always stay curious.
—BRAD WILLIAMS
To my grandmother, Angeline “Granny” Frazier, for keeping me fed with home‐cooked meals during the writing process.
—JUSTIN TADLOCK
To my wife, Keri, for her boundless support and patience. To Brad and Justin for inviting me along. To everyone who has helped me along the way. To Penny and Paul.
—JOHN JAMES JACOBY
BRAD WILLIAMS is the CEO and cofounder of WebDevStudios, one of the oldest and most respected WordPress agencies in the world. He is a coauthor of the Professional WordPress book series. Brad is the co‐organizer of WordCamp Philly 2010–2015 and the Philadelphia WordPress Meetup. He was also a co‐organizer for the Inaugural WordCamp US in 2015 and again in 2016. Brad has been developing websites for more than 20 years, including the last 10 where he has focused on open source technologies like WordPress.
JUSTIN TADLOCK began using WordPress in 2005 as a platform to share his writing. He fell in love with design and development, which prompted him to launch his first business in 2008. He ran Theme Hybrid, one of the earliest theme and plugin shops, for more than a decade. During this time, he created more than 70 plugins and themes for public release and many more for custom jobs. He also spent time as an administrator for the official WordPress theme review team. His latest adventure is writing for WP Tavern. Outside WordPress, Justin likes to collect films and makes time to read every day. You can follow his personal journey at justintadlock.com
.
JOHN JAMES JACOBY is a software developer who started writing code at 13 years old, late at night, in a dark bedroom, on a shabby computer that his dad spent way too much money on. He found bbPress first, then BuddyPress, and finally WordPressMU, which is now simply known as WordPress Multisite. He's been the project lead for BuddyPress and bbPress since 2008; is a member of the WordPress.org Administration and Security teams and a component maintainer for Multisite, Options, and User Roles; and has contributed to more than 50 free plugins on WordPress.org that are active on nearly 15 million websites. When he's not coding, he likes spending time at home with his family, paddle boarding, and grumping around his local community. You can find him on the web at jjj.blog
.
TO MY SON, LUCAS, for being my daily inspiration and best friend. To the love of my life, April, thank you for your endless support, friendship, and continuing to put up with my nerdy ways. To Lisa Sabin‐Wilson, your partnership and friendship have helped me grow not only as a business leader but as a person. To Justin and John, two amazing coauthors, your knowledge of WordPress is unmatched, and this book wouldn't have been what it is without you both. Thank you to the entire WordPress community for your support, friendships, motivation, and guidance over the years.
—BRAD WILLIAMS
To the WordPress community, you've been my online family for 15 years. You've given me an opportunity to have a career doing something I'm passionate about. It's been a wild ride thus far. To the thousands of users who've installed my plugins and themes, thank you for sticking with me all these years. To my parents, thank you for allowing me to dream big. To my family and friends, I'll try to find better dinner conversation topics than WordPress in the future. Thanks for lending an ear on a topic you know nothing about other than it being my job. To my cats, each day is a mixed bag of frustration and joy, but it's never boring. Thanks for mostly staying off my keyboard while I'm writing.
—JUSTIN TADLOCK
Thank you to Matt for his trust; Jen for calling me Jtrip; Jake for his words of wisdom; Andy, Boone, Paul, and Stephen for their leadership on the bbPress and BuddyPress plugins; Pippin for always putting people first; and everyone in the WordPress community for their support these past 13+ years. To my plugin users, thank you for your continued feedback to help make the little projects we enjoy as good as they can be. To my real‐life friends, thank you for being the quirky and fun people who you are. To my WordPress family, you are the greatest. To my parents, who always did their best with what they had. To you, dear reader, for making it this far.
—JOHN JAMES JACOBY
This book will teach you how to develop for WordPress. WordPress has, over the past two decades, grown into the CMS that powers more than one‐third of all websites. If you're proficient at WordPress development, you'll never be out of a job again.
Starting out as a simple blogging system, over the last few years WordPress has morphed into a fully featured and widely used content management system. It offers individuals and companies worldwide a free and open source alternative to closed source and often very expensive systems.
When I say fully featured, that's really only true because of the ability to add any functionality needed in the form of a plugin. The core of WordPress is simple: you add in functionality with plugins as you need it. Developing plugins allows you to stand on the shoulders of a giant: you can showcase your specific area of expertise and help users benefit while not having to deal with parts of WordPress you don't care or know about.
When I wrote the foreword of this book's first edition, nine years ago, I'd just started my own company. That company has since grown to consist of 100+ people, and our plugins are used on more than 10 million sites—all through the power of open source and plugins.
I wished that when I started developing plugins for WordPress as a hobby, almost 15 years back, this book had been around. I used it as a reference countless times since, and I still regularly hand this book to new colleagues.
The authors of this book have always been a source of good information and wonderful forces in the WordPress community. Each of them is an expert in his own right; together they are one of the best teams that could have been gathered to write this book, and I'm glad they're here for a second edition.
WordPress makes it easy for people to have their say through words, sound, and visuals. For those who write code, WordPress allows you to express yourself in code. And it's simple. Anyone can write a WordPress plugin. With this guide in hand, you can write a plugin that is true to WordPress’ original vision: code is poetry.
Happy coding!
Joost de Valk
Yoast.com
Dear reader, thank you for picking up this book! You have probably heard about WordPress already, the most popular self‐hosted content management system (CMS) and blogging software in use today. WordPress powers literally millions of websites on the Internet, including high‐profile sites such as TechCrunch and multiple Microsoft websites. What makes WordPress so popular is that it's free, open source, and extendable beyond limits. Thanks to a powerful, architecturally sound, and easy‐to‐use plugin system, you can customize how WordPress works and extend its functionalities. There are already more than 55,000 plugins freely available in the official plugin repository, but they won't suit all your needs or client requests. That's where this book comes in handy!
As of this writing, we (Brad, Justin, and John) have publicly released more than 100 plugins, which have been downloaded millions of times, and that's not counting private client work. This is a precious combined experience that we are going to leverage to teach you how to code your own plugins for WordPress by taking a hands‐on approach with practical examples and real‐life situations you will encounter with your clients.
The primary reason we wanted to write this book is to create a preeminent resource for WordPress plugin developers. When creating plugins for WordPress, it can be a challenge to find the resources needed in a single place. Many of the online tutorials and guides are outdated and recommend incorrect methods for plugin development. This book is one of the most extensive collections of plugin development information to date and should be considered required reading for anyone wanting to explore WordPress plugin development from the ground up.
This book is for professional web developers who want to make WordPress work exactly how they and their clients want. WordPress has already proven an exceptional platform for building any type of site from simple static pages to networks of full‐featured communities. Learning how to code plugins will help you get the most out of WordPress and have a cost‐effective approach to developing per‐client features.
This book is also for the code freelancers who want to broaden their skill portfolio, understand the inner workings of WordPress functionality, and take on WordPress gigs. Since WordPress is the most popular software to code and power websites, it is crucial that you understand how things run under the hood and how you can make the engine work your way. Learning how to code plugins will be a priceless asset to add to your résumé and business card.
Finally, this book is for hobbyist PHP programmers who want to tinker with how their WordPress blog works, discover the infinite potential of lean and flexible source code, and learn how they can interact with the flow of events. The beauty of open source is that it's easy to learn from and easy to give back in turn. This book will help you take your first step into a community that will welcome your creativity and contribution.
Simply put, this book is for anyone who wants to extend the way WordPress works, whether it is for fun or profit.
This book assumes you already have a web server and WordPress running. For your convenience, it is preferred that your web server runs on your localhost, as it will be easier to modify plugin files as you read through the book, but an online server is also fine.
Code snippets written in PHP are the backbone of this book. You should be comfortable with reading and writing basic PHP code or referring to PHP's documentation to fill any gaps in knowledge about fundamental functions. Advanced PHP code tricks are explained, so you don't need to be a PHP expert.
You will need to have rudimentary HTML knowledge to fully understand all the code. A basic acquaintance with database and MySQL syntax will help with grasping advanced subjects. To make the most of the chapter dedicated to JavaScript and Ajax, comprehension of JavaScript code will be a plus.
As of this writing, WordPress 5.5 is around the corner, and this book has been developed alongside this version. Following the best coding practices outlined in this book and using built‐in APIs are keys to future‐proof code that will not be deprecated when a newer version of WordPress is released. We believe that every code snippet in this book will still be accurate and up‐to‐date for several years, just as several plugins we coded many years ago are still completely functional today.
This book is, to date, one of the most powerful and comprehensive resources you can find about WordPress plugins. Advanced areas of the many WordPress APIs are covered, such as the REST API, cron jobs, and custom post types. This book is divided into three major parts. Reading the first five chapters is required if you are taking your first steps in the wonders of WordPress plugins. Chapters 6 through 9 will cover most common topics in coding plugins, and understanding them will be useful when reading subsequent chapters. The remaining chapters cover advanced APIs and functions, can be read in any order, and will sometimes refer to other chapters for details on a particular function.
To help you get the most from the text and keep track of what's happening, we've used a number of conventions throughout the book.
As for styles in the text:
We present code in two different ways:
We use a monofont type with no highlighting for most code examples.
We use bold to emphasize code that is particularly important in the present context or to show changes from a previous code snippet.
As you work through the examples in this book, you may choose either to type in all the code manually or to use the source code files that accompany the book. All the source code used in this book is available for download at www.wiley.com/go/prowordpressdev2e
on the Downloads tab.
We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books, such as a spelling mistake or faulty piece of code, we would be grateful for your feedback. By sending in errata, you may save another reader hours of frustration, and at the same time, you will be helping us provide even higher‐quality information.
To find the errata page for this book, go to www.wiley.com
and locate the title using the Search box. Then, on the book details page, click the Errata link. On this page, you can view all errata that have been submitted for this book and posted by editors. If you don't spot “your” error on the Errata page, go to support.wiley.com
and follow the directions to contact technical support and open a ticket to submit the error. We'll check the information and, if appropriate, post a message to the book's errata page and fix the problem in subsequent printings of the book.
WordPress is the most popular open source content management system available today. One of the primary reasons WordPress is so popular is the ease with which you can customize and extend WordPress through plugins. WordPress has an amazing framework in place that gives plugin developers the tools needed to extend WordPress in any way imaginable.
Understanding how plugins work, and the tools available in WordPress, is critical knowledge when developing professional WordPress plugins.
A plugin in WordPress is a PHP‐based script that extends or alters the core functionality of WordPress. Quite simply, plugins are files installed in WordPress to add a feature, or set of features, to WordPress. Plugins can range in complexity from a simple social networking plugin to an extremely elaborate eCommerce package. There is no limit to what a plugin can do in WordPress; because of this, there is no shortage of plugins available for download.
WordPress features many different APIs for use in your plugin. Each API, or application programming interface, helps interact with WordPress in a different way. The following are the main available APIs in WordPress and their function:
/custom‐page/
), structure tags (
%postname%
), and feed links (
/feed/json/
).There are additional, lesser known APIs that exist within the WordPress Core software. To view a full list, visit the Core Developer Handbook:
https://make.wordpress.org/core/handbook/best-practices/core-apis
WordPress also features pluggable functions. These functions enable you to override specific core functions in a plugin. For example, the wp_mail()
function is a pluggable function. You can easily define this function in your plugin and send email using the Simple Mail Transfer Protocol (SMTP) rather than the default method. All pluggable functions are defined in the /wp‐includes/pluggable.php
WordPress Core file.
As an example, let's look at the wp_mail()
pluggable function, which starts with this line of code:
if ( ! function_exists( 'wp_mail' ) ) :
You can see that the code first checks to see whether a wp_mail()
function already exists using the function_exists()
PHP function. If you created your own custom wp_mail()
function, that will be used; if not, the WordPress Core version of wp_mail()
will be used.
You can use some predefined functions during specific plugin tasks, such as when a plugin is activated or deactivated and even when a plugin is uninstalled. Chapter 2, “Plugin Framework,” covers these functions in detail.
Plugins are loaded early in the process when a WordPress‐powered web page is called. Figure 1‐1 shows a high‐level diagram of the standard loading process when loading a page in WordPress.
FIGURE 1‐1: Loading a page in WordPress
The flow changes slightly when loading an admin page. The differences are minor and primarily concern what theme is loaded: admin theme versus your website theme.
When researching available plugins, you need to know where to find WordPress plugins. You can download plugins from many places on the Internet, but this isn't always a good idea.
The first place to start when researching available WordPress plugins is the official Plugin Directory at WordPress.org
. The Plugin Directory is located at https://wordpress.org/plugins
. With more than 55,000 plugins available and millions of plugin downloads, it's easy to see the vital role plugins play in every WordPress website. All plugins available in the Plugin Directory are 100 percent GPL and free to use for personal or commercial use.
Take a look at some of the more popular WordPress plugins available to get a sense of their diversity:
https://wordpress.org/plugins/yoast-seo
https://wordpress.org/plugins/wpforms-lite
https://wordpress.org/plugins/buddypress
https://wordpress.org/plugins/woocommerce
https://wordpress.org/plugins/custom-post-type-ui
As you can see, the preceding plugins can handle a variety of complex tasks. The features added by these plugins are universal and features that many websites on the Internet could have.
Now you will look at some popular tags for plugins. Plugin tags are just like blog post tags, simple keywords that describe a plugin in the Plugin Directory. This makes it easy to search for existing plugins by tag. The following are popular examples:
https://wordpress.org/plugins/tags/twitter
https://wordpress.org/plugins/tags/google
https://wordpress.org/plugins/tags/blocks
Viewing popular plugin tags can provide inspiration when developing new plugins for WordPress.
WordPress offers many advantages when using plugins. It's important to understand the advantages of building plugins to truly understand why you should spend time building them. This can also help when determining the need for a specific plugin in WordPress.
One of the main advantages to plugins is the ability to modify the behavior of WordPress without modifying any core files. Core files refer to any file that is part of the default WordPress installation.
Hacking core files can make it difficult to update WordPress when a new version is released. If you made any modifications to a core file, that modification would be overwritten when the update occurs. Keeping WordPress up‐to‐date with the latest version is essential in keeping your website secure.
Modifying core files can also lead to an unstable website. Different areas of WordPress rely on other areas to function as expected. If you modify a core file and it no longer works as expected, it can cause instability and quite possibly break a completely unrelated feature in WordPress.
Another advantage to building plugins is the structure that already exists for your plugin. Many of the common features have already been developed and are ready for use in your plugin. For example, you can take advantage of the built‐in user roles in WordPress. Using the user roles, you can easily restrict your code to execute only if a user is an administrator. Look at this example:
<?php
if ( current_user_can( 'manage_options' ) ) {
//any code entered here will only be executed IF
//user is an administrator
}
?>
As you can see, it's easy to verify that a user has proper permissions prior to executing any code in your plugin. You will learn about user accounts and roles in Chapter 9, “Users and User Data.”
As another example, look at sending an email in WordPress. Sure, you could create a new function in your plugin to send email, but why? WordPress has a handy function called wp_mail()
for sending email. Look at this example:
<?php
$email_to = 'you@example.com';
$email_subject = 'Plugin email example';
$email_message = 'How do you like my new plugin?';
wp_mail( $email_to, $email_subject, $email_message );
?>
As you can see, sending an email in WordPress couldn't be easier. Unless your plugin needs some customized emailing functionality, you don't need to re‐create this function from scratch. Using this function also ensures the widest adoption for sending emails from WordPress because you use the built‐in function.
Using the available built‐in features of WordPress can greatly reduce the time to develop a plugin. Another advantage of not reinventing the wheel is that this approach more often than not will allow for your plugins to work across a greater number of servers and setups, thereby maximizing compatibility. Don't reinvent the wheel with features that already exist in WordPress.
A plugin can take control of the rendering process; therefore, the plugin can become a “theme.” Similarly, a theme can have plugin functionality included. Because of this, the difference between the two can sometimes become blurred, so why not just include your plugin code directly in a theme? This is a common question and one that can have a few different answers.
Should themes include plugin functionality? The short answer is no. The primary reason for this is because plugins are meant to add features and functionality to WordPress, regardless of the theme used. This creates a nice separation between your website design and the functionality of your website. The reason this separation is needed is so your theme is not directly tied to the functionality required. WordPress is built so that you can easily change your design, or theme, at any point with just a couple clicks. If all plugin functionality existed in your theme and you switched themes, you will have lost all that functionality you required.
There is also a strong argument that certain features should be included in a theme. A common feature most themes include is breadcrumb navigation. This feature could certainly exist in a plugin, and there are many plugins available for this, but it makes more sense to include this navigation‐centric feature in the theme.
WordPress makes it easy to update a plugin to the latest version. Every plugin installed from the WordPress.org
Plugin Directory alerts you when a new version of the plugin has been released. Updating the plugin is as simple as clicking the update notification listed just below the plugin details on the Plugin screen of your WordPress Dashboard.
Plugins not installed from the Plugin Directory can also be updated using the auto‐update functionality of WordPress. This is the method that premium plugins, specifically plugins that are sold on third‐party websites outside of the Plugin Directory, push out updates to their plugins. The plugin author must define where WordPress can download the latest version, and WordPress will take care of the rest. If the plugin author doesn't define this location, you must manually update the plugin.
Keeping plugins updated is an important part of keeping your website free from security vulnerabilities and bugs.
Plugins are easy to share with others. It's much easier to share a plugin than tell someone to modify specific lines of code in your theme or WordPress. Using plugins also makes it easy to use the same functionality across multiple sites. If you find a group of plugins that you like, you can easily install them on every WordPress website you create.
When you activate a broken plugin in WordPress, it won't break your site. If the plugin triggers a fatal error, WordPress automatically deactivates the plugin before it has a chance to wreak havoc. This fail‐safe feature makes it less risky when activating and testing new plugins. Even if the plugin does cause a white screen of death (error message), you can easily rename the plugin folder directly on your web server, and WordPress deactivates the plugin. This makes it impossible for a rogue plugin to lock you out of your own site because of an error.
On the other hand, if you were to hack the WordPress Core, you could cause fatal errors that would crash your website. This can also include causing unrecoverable damage to WordPress.
A huge community is centered around plugin development, sharing knowledge and code, and creating amazing plugins. Getting involved in the community is a great way to take your plugin development skills to the next level. Chapter 16, “The Developer Toolbox,” covers many of these resources.
All plugin management in WordPress happens on the Plugins screen in the WordPress Dashboard. The menu shown in Figure 1‐2 is available only to administrators in WordPress, so non‐administrators cannot see this menu. If you use the Multisite feature of WordPress, the Plugins menu is hidden by default. You need to enable the menu using My Sites ➪ Network Admin ➪ Settings.
FIGURE 1‐2: Plugins menu
WordPress features three different methods for installing a new plugin. Your server setup dictates which method is the best to use.
The first method uses the built‐in auto‐installer. This method enables you to search the Plugin Directory on WordPress.org
directly from the Dashboard of your WordPress website. Simply visit Plugins ➪ Add New from your WordPress Dashboard to search for a plugin. After you find a plugin to install, click the Install Now button, and the plugin automatically downloads and installs.
The second method uses the zip uploader. Zipped plugin files can be uploaded, extracted, and installed by WordPress. To use this method, click the Upload Plugin button at the top of the Add Plugins page. Click the Choose File button and select the plugin zip file you want to install. After you select the plugin, click the Install Now button, as shown in Figure 1‐3.
FIGURE 1‐3: Install Now button
The third and final method to install a plugin in WordPress uses Secure (or SSH) File Transfer Protocol (SFTP). Using SFTP involves simply connecting to your web server using an SFTP client and manually uploading the plugin to your WordPress installation. To use this method, upload the uncompressed plugin folder or file to the wp‐content/plugins
directory on your web server.
After you install a plugin in WordPress, you can manage it, along with all other plugins, on the Plugins ➪ Installed Plugins screen. Here you can find a list of all plugins, active or not, available in your WordPress installation. You can easily activate, deactivate, edit, update, and delete plugins from this screen.
The Plugin screen also features bulk actions for activating, deactivating, updating, and deleting plugins. Check all the plugins you want to manage and then select the appropriate bulk action from the drop‐down menu. This process makes managing multiple plugins a breeze!
WordPress features a built‐in plugin editor on the Plugins ➪ Plugin Editor screen. The plugin editor enables you to view and edit the source code of any plugin installed in WordPress. Keep in mind you can edit the source code only if the plugin file is writable by the web server; otherwise, you can only view the code.
To use the editor, select the plugin from the drop‐down menu on the top‐right portion of the Edit Plugins page. The editor lists all files associated with the selected plugin. There is also a documentation lookup feature that makes it easy to research a specific function's purpose in the plugin you are reviewing.
A lesser known fact is that WordPress actually features two plugin directories. The primary directory is located at wp‐content/plugins
in a standard WordPress installation. The second, lesser known plugin directory is at wp‐content/mu‐plugins
. The mu‐plugins
directory, which stands for Must‐Use, is not automatically created by WordPress, so it must be manually created to be used.
The primary difference between the two is that the mu‐plugins
directory is for plugins that are always executed. This means any plugin included in this directory will automatically be loaded in WordPress and across all sites in the network if you run Multisite. Mu‐plugins are always on and cannot be deactivated.
WordPress features a few different types and statuses for plugins, as shown in Figure 1‐4. You need to understand the difference when administering and creating plugins for WordPress.
FIGURE 1‐4: Types and statuses for plugins
wp‐content/mu‐plugins
directory. All Must‐Use, or MU, plugins are loaded automatically. The only way to deactivate an MU plugin is to remove it completely from the directory.wp‐content
directory. If WordPress detects one of these files, it will be automatically loaded and listed under the Drop‐in filter on the Plugin screen. Currently ten Drop‐in plugins are available.
advanced‐cache.php
: Advanced caching plugindb.php
: Custom database classdb‐error.php
: Custom database error messageinstall.php
: Custom installation scriptmaintenance.php
: Custom maintenance messageobject‐cache.php
: External object cachesunrise.php
: Advanced domain mappingblog‐deleted.php
: Custom blog deleted messageblog‐inactive.php
: Custom blog inactive messageblog‐suspended.php
: Custom blog suspended messageThe last four Drop‐in plugins are specific to the WordPress Multisite feature. A standard WordPress installation will have no use for these plugins.
When developing a new plugin, determine what type of plugin you want to create before you start the development process. Most plugins will be standard WordPress plugins, but occasionally you might need to create a Must‐Use or Drop‐in plugin.
In this chapter, you learned about plugins and how they can interact with WordPress using the available APIs. The major advantages to using plugins and why plugin functionality shouldn't always be included in a theme were discussed. Installing and managing plugins in the WordPress Dashboard was covered.
Now that you understand how plugins work in WordPress, it's time to create the plugin foundation!